-
Notifications
You must be signed in to change notification settings - Fork 0
/
id.c
135 lines (118 loc) · 4.44 KB
/
id.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/**********************************************************************
id.c -
$Author: ko1 $
created at: Thu Jul 12 04:37:51 2007
Copyright (C) 2004-2007 Koichi Sasada
**********************************************************************/
#include "ruby/ruby.h"
#include "ruby/node.h"
#include "vm.h"
#define extern
#include "id.h"
#undef extern
void
Init_id(void)
{
/* Symbols */
symIFUNC = ID2SYM(rb_intern("<IFUNC>"));
symCFUNC = ID2SYM(rb_intern("<CFUNC>"));
/* IDs */
idPLUS = rb_intern("+");
idMINUS = rb_intern("-");
idMULT = rb_intern("*");
idDIV = rb_intern("/");
idMOD = rb_intern("%");
idLT = rb_intern("<");
idLTLT = rb_intern("<<");
idLE = rb_intern("<=");
idGT = rb_intern(">");
idGE = rb_intern(">=");
idEq = rb_intern("==");
idEqq = rb_intern("===");
idBackquote = rb_intern("`");
idEqTilde = rb_intern("=~");
idNot = rb_intern("!");
idNeq = rb_intern("!=");
#if WITH_OBJC
selPLUS = sel_registerName("+:");
selMINUS = sel_registerName("-:");
selMULT = sel_registerName("*:");
selDIV = sel_registerName("/:");
selMOD = sel_registerName("%:");
selEq = sel_registerName("==:");
selNeq = sel_registerName("!=:");
selCmp = sel_registerName("<=>:");
selLT = sel_registerName("<:");
selLE = sel_registerName("<=:");
selGT = sel_registerName(">:");
selGE = sel_registerName(">=:");
selLTLT = sel_registerName("<<:");
selAREF = sel_registerName("[]:");
selASET = sel_registerName("[]=:");
selLength = sel_registerName("length");
selSucc = sel_registerName("succ");
selNot = sel_registerName("!");
selAlloc = sel_registerName("alloc");
selAllocWithZone = sel_registerName("allocWithZone:");
selInit = sel_registerName("init");
selInitialize = sel_registerName("initialize");
selInitialize2 = sel_registerName("initialize:");
selInitializeCopy = sel_registerName("initialize_copy:");
selDescription = sel_registerName("description");
selInspect = sel_registerName("inspect");
selNew = sel_registerName("new");
selRespondTo = sel_registerName("respond_to?:");
selMethodMissing = sel_registerName("method_missing:");
selCopy = sel_registerName("copy");
selMutableCopy = sel_registerName("mutableCopy");
sel_ignored = sel_registerName("retain");
assert(sel_ignored == sel_registerName("release"));
sel_zone = sel_registerName("zone");
selToS = sel_registerName("to_s");
selToAry = sel_registerName("to_ary");
selSend = sel_registerName("send:");
sel__send__ = sel_registerName("__send__:");
selEqTilde = sel_registerName("=~:");
selClass = sel_registerName("class");
selEval = sel_registerName("eval:");
selInstanceEval = sel_registerName("instance_eval:");
selClassEval = sel_registerName("class_eval:");
selModuleEval = sel_registerName("module_eval:");
selLocalVariables = sel_registerName("local_variables");
selBinding = sel_registerName("binding");
selEach = sel_registerName("each");
selEqq = sel_registerName("===:");
selDup = sel_registerName("dup");
selBackquote = sel_registerName("`:");
selMethodAdded = sel_registerName("method_added:");
selSingletonMethodAdded = sel_registerName("singleton_method_added:");
selIsEqual = sel_registerName("isEqual:");
selWrite = sel_registerName("write:");
selInherited = sel_registerName("inherited:");
cacheEach = rb_vm_get_call_cache(selEach);
#endif
idAREF = rb_intern("[]");
idASET = rb_intern("[]=");
idEach = rb_intern("each");
idTimes = rb_intern("times");
idLength = rb_intern("length");
idLambda = rb_intern("lambda");
idIntern = rb_intern("intern");
idGets = rb_intern("gets");
idSucc = rb_intern("succ");
idEnd = rb_intern("end");
idRangeEachLT = rb_intern("Range#each#LT");
idRangeEachLE = rb_intern("Range#each#LE");
idArrayEach = rb_intern("Array#each");
idMethodMissing = rb_intern("method_missing");
idThrowState = rb_intern("#__ThrowState__");
idBitblt = rb_intern("bitblt");
idAnswer = rb_intern("the_answer_to_life_the_universe_and_everything");
idSend = rb_intern("send");
id__send__ = rb_intern("__send__");
idRespond_to = rb_intern("respond_to?");
idInitialize = rb_intern("initialize");
idIncludedModules = rb_intern("__included_modules__");
idIncludedInClasses = rb_intern("__included_in_classes__");
idAncestors = rb_intern("__ancestors__");
}