Ruby 3.5.0dev (2025-05-06 revision cbf9c088f8005a49b6aa3f475c70041357774c61)
id.c
1/* DO NOT EDIT THIS FILE DIRECTLY */
2/**********************************************************************
3
4 id.c -
5
6 $Author$
7 created at: Wed Dec 5 02:36:10 2012
8
9 Copyright (C) 2004-2007 Koichi Sasada
10
11**********************************************************************/
12
13#define tDOT2 RUBY_TOKEN(DOT2)
14#define tDOT3 RUBY_TOKEN(DOT3)
15#define tUPLUS RUBY_TOKEN(UPLUS)
16#define tUMINUS RUBY_TOKEN(UMINUS)
17#define tPOW RUBY_TOKEN(POW)
18#define tCMP RUBY_TOKEN(CMP)
19#define tLSHFT RUBY_TOKEN(LSHFT)
20#define tRSHFT RUBY_TOKEN(RSHFT)
21#define tLEQ RUBY_TOKEN(LEQ)
22#define tGEQ RUBY_TOKEN(GEQ)
23#define tEQ RUBY_TOKEN(EQ)
24#define tEQQ RUBY_TOKEN(EQQ)
25#define tNEQ RUBY_TOKEN(NEQ)
26#define tMATCH RUBY_TOKEN(MATCH)
27#define tNMATCH RUBY_TOKEN(NMATCH)
28#define tAREF RUBY_TOKEN(AREF)
29#define tASET RUBY_TOKEN(ASET)
30#define tCOLON2 RUBY_TOKEN(COLON2)
31#define tANDOP RUBY_TOKEN(ANDOP)
32#define tOROP RUBY_TOKEN(OROP)
33#define tANDDOT RUBY_TOKEN(ANDDOT)
34
35static const struct {
36 unsigned short token;
37 RBIMPL_ATTR_NONSTRING() const char name[3];
38 const char term;
39} op_tbl[] = {
40 {tDOT2, ".."},
41 {tDOT3, "..."},
42 {tUPLUS, "+@"},
43 {tUMINUS, "-@"},
44 {tPOW, "**"},
45 {tCMP, "<=>"},
46 {tLSHFT, "<<"},
47 {tRSHFT, ">>"},
48 {tLEQ, "<="},
49 {tGEQ, ">="},
50 {tEQ, "=="},
51 {tEQQ, "==="},
52 {tNEQ, "!="},
53 {tMATCH, "=~"},
54 {tNMATCH, "!~"},
55 {tAREF, "[]"},
56 {tASET, "[]="},
57 {tCOLON2, "::"},
58 {tANDOP, "&&"},
59 {tOROP, "||"},
60 {tANDDOT, "&."},
61};
62
63static void
64Init_id(void)
65{
66 rb_encoding *enc = rb_usascii_encoding();
67
68 REGISTER_SYMID(idMax, "max");
69 REGISTER_SYMID(idMin, "min");
70 REGISTER_SYMID(idHash, "hash");
71 REGISTER_SYMID(idFreeze, "freeze");
72 REGISTER_SYMID(idNilP, "nil?");
73 REGISTER_SYMID(idInspect, "inspect");
74 REGISTER_SYMID(idIntern, "intern");
75 REGISTER_SYMID(idObject_id, "object_id");
76 REGISTER_SYMID(id__id__, "__id__");
77 REGISTER_SYMID(idConst_added, "const_added");
78 REGISTER_SYMID(idConst_missing, "const_missing");
79 REGISTER_SYMID(idMethodMissing, "method_missing");
80 REGISTER_SYMID(idMethod_added, "method_added");
81 REGISTER_SYMID(idSingleton_method_added, "singleton_method_added");
82 REGISTER_SYMID(idMethod_removed, "method_removed");
83 REGISTER_SYMID(idSingleton_method_removed, "singleton_method_removed");
84 REGISTER_SYMID(idMethod_undefined, "method_undefined");
85 REGISTER_SYMID(idSingleton_method_undefined, "singleton_method_undefined");
86 REGISTER_SYMID(idLength, "length");
87 REGISTER_SYMID(idSize, "size");
88 REGISTER_SYMID(idGets, "gets");
89 REGISTER_SYMID(idSucc, "succ");
90 REGISTER_SYMID(idEach, "each");
91 REGISTER_SYMID(idProc, "proc");
92 REGISTER_SYMID(idLambda, "lambda");
93 REGISTER_SYMID(idSend, "send");
94 REGISTER_SYMID(id__send__, "__send__");
95 REGISTER_SYMID(id__recursive_key__, "__recursive_key__");
96 REGISTER_SYMID(idInitialize, "initialize");
97 REGISTER_SYMID(idInitialize_copy, "initialize_copy");
98 REGISTER_SYMID(idInitialize_clone, "initialize_clone");
99 REGISTER_SYMID(idInitialize_dup, "initialize_dup");
100 REGISTER_SYMID(idTo_int, "to_int");
101 REGISTER_SYMID(idTo_ary, "to_ary");
102 REGISTER_SYMID(idTo_str, "to_str");
103 REGISTER_SYMID(idTo_sym, "to_sym");
104 REGISTER_SYMID(idTo_hash, "to_hash");
105 REGISTER_SYMID(idTo_proc, "to_proc");
106 REGISTER_SYMID(idTo_io, "to_io");
107 REGISTER_SYMID(idTo_a, "to_a");
108 REGISTER_SYMID(idTo_s, "to_s");
109 REGISTER_SYMID(idTo_i, "to_i");
110 REGISTER_SYMID(idTo_f, "to_f");
111 REGISTER_SYMID(idTo_r, "to_r");
112 REGISTER_SYMID(idBt, "bt");
113 REGISTER_SYMID(idBt_locations, "bt_locations");
114 REGISTER_SYMID(idCall, "call");
115 REGISTER_SYMID(idMesg, "mesg");
116 REGISTER_SYMID(idException, "exception");
117 REGISTER_SYMID(idLocals, "locals");
118 REGISTER_SYMID(idNOT, "not");
119 REGISTER_SYMID(idAND, "and");
120 REGISTER_SYMID(idOR, "or");
121 REGISTER_SYMID(idDiv, "div");
122 REGISTER_SYMID(idDivmod, "divmod");
123 REGISTER_SYMID(idFdiv, "fdiv");
124 REGISTER_SYMID(idQuo, "quo");
125 REGISTER_SYMID(idName, "name");
126 REGISTER_SYMID(idNil, "nil");
127 REGISTER_SYMID(idPath, "path");
128 REGISTER_SYMID(idPack, "pack");
129 REGISTER_SYMID(idBuffer, "buffer");
130 REGISTER_SYMID(idIncludeP, "include?");
131 REGISTER_SYMID(idUScore, "_");
132 REGISTER_SYMID(idNUMPARAM_1, "_1");
133 REGISTER_SYMID(idNUMPARAM_2, "_2");
134 REGISTER_SYMID(idNUMPARAM_3, "_3");
135 REGISTER_SYMID(idNUMPARAM_4, "_4");
136 REGISTER_SYMID(idNUMPARAM_5, "_5");
137 REGISTER_SYMID(idNUMPARAM_6, "_6");
138 REGISTER_SYMID(idNUMPARAM_7, "_7");
139 REGISTER_SYMID(idNUMPARAM_8, "_8");
140 REGISTER_SYMID(idNUMPARAM_9, "_9");
141 REGISTER_SYMID(idNULL, ""/*NULL*/"");
142 REGISTER_SYMID(idEmptyP, "empty?");
143 REGISTER_SYMID(idEqlP, "eql?");
144 REGISTER_SYMID(idDefault, "default");
145 REGISTER_SYMID(idRespond_to, "respond_to?");
146 REGISTER_SYMID(idRespond_to_missing, "respond_to_missing?");
147 REGISTER_SYMID(idIFUNC, "<IFUNC>");
148 REGISTER_SYMID(idCFUNC, "<CFUNC>");
149 REGISTER_SYMID(id_core_set_method_alias, "core#set_method_alias");
150 REGISTER_SYMID(id_core_set_variable_alias, "core#set_variable_alias");
151 REGISTER_SYMID(id_core_undef_method, "core#undef_method");
152 REGISTER_SYMID(id_core_define_method, "core#define_method");
153 REGISTER_SYMID(id_core_define_singleton_method, "core#define_singleton_method");
154 REGISTER_SYMID(id_core_set_postexe, "core#set_postexe");
155 REGISTER_SYMID(id_core_hash_merge_ptr, "core#hash_merge_ptr");
156 REGISTER_SYMID(id_core_hash_merge_kwd, "core#hash_merge_kwd");
157 REGISTER_SYMID(id_core_raise, "core#raise");
158 REGISTER_SYMID(id_core_sprintf, "core#sprintf");
159 REGISTER_SYMID(idLASTLINE, "$_");
160 REGISTER_SYMID(idBACKREF, "$~");
161 REGISTER_SYMID(idERROR_INFO, "$!");
162 REGISTER_SYMID(idRuby, "Ruby");
163}
#define RBIMPL_ATTR_NONSTRING()
Wraps (or simulates) __attribute__((nonstring))
Definition nonstring.h:34