rubinius-melbourne 1.2.1.0 → 2.0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -2
- data/Rakefile +0 -44
- data/ext/rubinius/melbourne/encoding_compat.cpp +188 -0
- data/ext/rubinius/melbourne/encoding_compat.hpp +57 -0
- data/ext/rubinius/melbourne/extconf.rb +18 -13
- data/ext/rubinius/melbourne/grammar.cpp +8850 -7662
- data/ext/rubinius/melbourne/grammar.hpp +2 -4
- data/ext/rubinius/melbourne/grammar.y +5754 -4769
- data/ext/rubinius/melbourne/lex.c.blt +152 -0
- data/ext/rubinius/melbourne/melbourne.cpp +15 -14
- data/ext/rubinius/melbourne/melbourne.hpp +1 -0
- data/ext/rubinius/melbourne/node.hpp +87 -78
- data/ext/rubinius/melbourne/node_types.cpp +108 -114
- data/ext/rubinius/melbourne/node_types.hpp +13 -16
- data/ext/rubinius/melbourne/node_types.rb +13 -16
- data/ext/rubinius/melbourne/parser_state.hpp +93 -33
- data/ext/rubinius/melbourne/var_table.cpp +51 -56
- data/ext/rubinius/melbourne/var_table.hpp +25 -22
- data/ext/rubinius/melbourne/visitor.cpp +227 -206
- data/ext/rubinius/melbourne/visitor.hpp +5 -2
- data/lib/rubinius/melbourne.rb +23 -3
- data/lib/rubinius/melbourne/version.rb +2 -2
- data/rubinius-melbourne.gemspec +6 -8
- metadata +12 -72
- data/ext/rubinius/melbourne/bstring-license.txt +0 -29
- data/ext/rubinius/melbourne/bstrlib.cpp +0 -2687
- data/ext/rubinius/melbourne/bstrlib.h +0 -267
- data/ext/rubinius/melbourne/lex.c.tab +0 -136
- data/ext/rubinius/melbourne/local_state.hpp +0 -41
- data/ext/rubinius/melbourne/quark.cpp +0 -43
- data/ext/rubinius/melbourne/quark.hpp +0 -49
@@ -7,9 +7,6 @@
|
|
7
7
|
|
8
8
|
namespace MELBOURNE {
|
9
9
|
static const char node_types[] = {
|
10
|
-
"method\0"
|
11
|
-
"fbody\0"
|
12
|
-
"cfunc\0"
|
13
10
|
"scope\0"
|
14
11
|
"block\0"
|
15
12
|
"if\0"
|
@@ -30,13 +27,13 @@ namespace MELBOURNE {
|
|
30
27
|
"ensure\0"
|
31
28
|
"and\0"
|
32
29
|
"or\0"
|
33
|
-
"not\0"
|
34
30
|
"masgn\0"
|
35
31
|
"lasgn\0"
|
36
32
|
"dasgn\0"
|
37
33
|
"dasgn_curr\0"
|
38
34
|
"gasgn\0"
|
39
35
|
"iasgn\0"
|
36
|
+
"iasgn2\0"
|
40
37
|
"cdecl\0"
|
41
38
|
"cvasgn\0"
|
42
39
|
"cvdecl\0"
|
@@ -51,6 +48,7 @@ namespace MELBOURNE {
|
|
51
48
|
"zsuper\0"
|
52
49
|
"array\0"
|
53
50
|
"zarray\0"
|
51
|
+
"values\0"
|
54
52
|
"hash\0"
|
55
53
|
"return\0"
|
56
54
|
"yield\0"
|
@@ -74,11 +72,13 @@ namespace MELBOURNE {
|
|
74
72
|
"dregx\0"
|
75
73
|
"dregx_once\0"
|
76
74
|
"args\0"
|
75
|
+
"args_aux\0"
|
76
|
+
"opt_arg\0"
|
77
|
+
"postarg\0"
|
77
78
|
"argscat\0"
|
78
79
|
"argspush\0"
|
79
80
|
"splat\0"
|
80
81
|
"to_ary\0"
|
81
|
-
"svalue\0"
|
82
82
|
"block_arg\0"
|
83
83
|
"block_pass\0"
|
84
84
|
"defn\0"
|
@@ -91,158 +91,152 @@ namespace MELBOURNE {
|
|
91
91
|
"sclass\0"
|
92
92
|
"colon2\0"
|
93
93
|
"colon3\0"
|
94
|
-
"cref\0"
|
95
94
|
"dot2\0"
|
96
95
|
"dot3\0"
|
97
96
|
"flip2\0"
|
98
97
|
"flip3\0"
|
99
|
-
"attrset\0"
|
100
98
|
"self\0"
|
101
99
|
"nil\0"
|
102
100
|
"true\0"
|
103
101
|
"false\0"
|
102
|
+
"errinfo\0"
|
104
103
|
"defined\0"
|
105
|
-
"newline\0"
|
106
104
|
"postexe\0"
|
107
|
-
"
|
105
|
+
"alloca\0"
|
108
106
|
"bmethod\0"
|
109
107
|
"memo\0"
|
110
108
|
"ifunc\0"
|
111
109
|
"dsym\0"
|
112
110
|
"attrasgn\0"
|
111
|
+
"prelude\0"
|
112
|
+
"lambda\0"
|
113
|
+
"optblock\0"
|
114
|
+
"last\0"
|
115
|
+
"file\0"
|
113
116
|
"regex\0"
|
114
|
-
"fixnum\0"
|
115
117
|
"number\0"
|
116
|
-
"hexnum\0"
|
117
|
-
"binnum\0"
|
118
|
-
"octnum\0"
|
119
118
|
"float\0"
|
120
|
-
"
|
121
|
-
"last\0"
|
122
|
-
"file\0"
|
119
|
+
"encoding\0"
|
123
120
|
"preexe\0"
|
124
121
|
};
|
125
122
|
|
126
123
|
static const unsigned short node_types_offsets[] = {
|
127
124
|
0,
|
128
|
-
|
129
|
-
|
130
|
-
|
125
|
+
6,
|
126
|
+
12,
|
127
|
+
15,
|
128
|
+
20,
|
131
129
|
25,
|
132
130
|
31,
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
82,
|
131
|
+
37,
|
132
|
+
43,
|
133
|
+
48,
|
134
|
+
52,
|
135
|
+
58,
|
136
|
+
63,
|
137
|
+
68,
|
138
|
+
74,
|
139
|
+
80,
|
143
140
|
87,
|
144
|
-
|
145
|
-
|
141
|
+
95,
|
142
|
+
102,
|
146
143
|
106,
|
147
|
-
|
144
|
+
109,
|
145
|
+
115,
|
148
146
|
121,
|
149
|
-
|
150
|
-
128,
|
151
|
-
132,
|
147
|
+
127,
|
152
148
|
138,
|
153
149
|
144,
|
154
150
|
150,
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
151
|
+
157,
|
152
|
+
163,
|
153
|
+
170,
|
154
|
+
177,
|
159
155
|
186,
|
160
|
-
|
161
|
-
|
162
|
-
|
156
|
+
195,
|
157
|
+
207,
|
158
|
+
218,
|
163
159
|
223,
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
160
|
+
229,
|
161
|
+
235,
|
162
|
+
241,
|
163
|
+
248,
|
164
|
+
254,
|
165
|
+
261,
|
166
|
+
268,
|
167
|
+
273,
|
168
|
+
280,
|
169
|
+
286,
|
170
|
+
291,
|
171
|
+
296,
|
172
|
+
301,
|
173
|
+
306,
|
174
|
+
312,
|
175
|
+
317,
|
176
|
+
325,
|
181
177
|
334,
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
178
|
+
340,
|
179
|
+
347,
|
180
|
+
354,
|
181
|
+
358,
|
182
|
+
362,
|
186
183
|
367,
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
410,
|
184
|
+
372,
|
185
|
+
378,
|
186
|
+
384,
|
187
|
+
390,
|
188
|
+
401,
|
189
|
+
406,
|
194
190
|
415,
|
195
191
|
423,
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
192
|
+
431,
|
193
|
+
439,
|
194
|
+
448,
|
195
|
+
454,
|
196
|
+
461,
|
197
|
+
471,
|
198
|
+
482,
|
199
|
+
487,
|
200
|
+
492,
|
201
|
+
498,
|
202
|
+
505,
|
203
|
+
511,
|
204
|
+
517,
|
205
|
+
524,
|
206
|
+
531,
|
207
|
+
538,
|
208
|
+
545,
|
209
|
+
550,
|
210
|
+
555,
|
211
|
+
561,
|
212
|
+
567,
|
213
|
+
572,
|
218
214
|
576,
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
215
|
+
581,
|
216
|
+
587,
|
217
|
+
595,
|
218
|
+
603,
|
219
|
+
611,
|
220
|
+
618,
|
221
|
+
626,
|
226
222
|
631,
|
227
|
-
|
223
|
+
637,
|
228
224
|
642,
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
720,
|
241
|
-
727
|
225
|
+
651,
|
226
|
+
659,
|
227
|
+
666,
|
228
|
+
675,
|
229
|
+
680,
|
230
|
+
685,
|
231
|
+
691,
|
232
|
+
698,
|
233
|
+
704,
|
234
|
+
713,
|
235
|
+
720
|
242
236
|
};
|
243
237
|
|
244
238
|
const char *get_node_type_string(enum node_type node) {
|
245
|
-
if(node <
|
239
|
+
if(node < 111) {
|
246
240
|
return node_types + node_types_offsets[node];
|
247
241
|
} else {
|
248
242
|
#define NODE_STRING_MESSAGE_LEN 20
|
@@ -4,9 +4,6 @@
|
|
4
4
|
|
5
5
|
namespace MELBOURNE {
|
6
6
|
enum node_type {
|
7
|
-
NODE_METHOD,
|
8
|
-
NODE_FBODY,
|
9
|
-
NODE_CFUNC,
|
10
7
|
NODE_SCOPE,
|
11
8
|
NODE_BLOCK,
|
12
9
|
NODE_IF,
|
@@ -27,13 +24,13 @@ namespace MELBOURNE {
|
|
27
24
|
NODE_ENSURE,
|
28
25
|
NODE_AND,
|
29
26
|
NODE_OR,
|
30
|
-
NODE_NOT,
|
31
27
|
NODE_MASGN,
|
32
28
|
NODE_LASGN,
|
33
29
|
NODE_DASGN,
|
34
30
|
NODE_DASGN_CURR,
|
35
31
|
NODE_GASGN,
|
36
32
|
NODE_IASGN,
|
33
|
+
NODE_IASGN2,
|
37
34
|
NODE_CDECL,
|
38
35
|
NODE_CVASGN,
|
39
36
|
NODE_CVDECL,
|
@@ -48,6 +45,7 @@ namespace MELBOURNE {
|
|
48
45
|
NODE_ZSUPER,
|
49
46
|
NODE_ARRAY,
|
50
47
|
NODE_ZARRAY,
|
48
|
+
NODE_VALUES,
|
51
49
|
NODE_HASH,
|
52
50
|
NODE_RETURN,
|
53
51
|
NODE_YIELD,
|
@@ -71,11 +69,13 @@ namespace MELBOURNE {
|
|
71
69
|
NODE_DREGX,
|
72
70
|
NODE_DREGX_ONCE,
|
73
71
|
NODE_ARGS,
|
72
|
+
NODE_ARGS_AUX,
|
73
|
+
NODE_OPT_ARG,
|
74
|
+
NODE_POSTARG,
|
74
75
|
NODE_ARGSCAT,
|
75
76
|
NODE_ARGSPUSH,
|
76
77
|
NODE_SPLAT,
|
77
78
|
NODE_TO_ARY,
|
78
|
-
NODE_SVALUE,
|
79
79
|
NODE_BLOCK_ARG,
|
80
80
|
NODE_BLOCK_PASS,
|
81
81
|
NODE_DEFN,
|
@@ -88,35 +88,32 @@ namespace MELBOURNE {
|
|
88
88
|
NODE_SCLASS,
|
89
89
|
NODE_COLON2,
|
90
90
|
NODE_COLON3,
|
91
|
-
NODE_CREF,
|
92
91
|
NODE_DOT2,
|
93
92
|
NODE_DOT3,
|
94
93
|
NODE_FLIP2,
|
95
94
|
NODE_FLIP3,
|
96
|
-
NODE_ATTRSET,
|
97
95
|
NODE_SELF,
|
98
96
|
NODE_NIL,
|
99
97
|
NODE_TRUE,
|
100
98
|
NODE_FALSE,
|
99
|
+
NODE_ERRINFO,
|
101
100
|
NODE_DEFINED,
|
102
|
-
NODE_NEWLINE,
|
103
101
|
NODE_POSTEXE,
|
104
|
-
|
102
|
+
NODE_ALLOCA,
|
105
103
|
NODE_BMETHOD,
|
106
104
|
NODE_MEMO,
|
107
105
|
NODE_IFUNC,
|
108
106
|
NODE_DSYM,
|
109
107
|
NODE_ATTRASGN,
|
108
|
+
NODE_PRELUDE,
|
109
|
+
NODE_LAMBDA,
|
110
|
+
NODE_OPTBLOCK,
|
111
|
+
NODE_LAST,
|
112
|
+
NODE_FILE,
|
110
113
|
NODE_REGEX,
|
111
|
-
NODE_FIXNUM,
|
112
114
|
NODE_NUMBER,
|
113
|
-
NODE_HEXNUM,
|
114
|
-
NODE_BINNUM,
|
115
|
-
NODE_OCTNUM,
|
116
115
|
NODE_FLOAT,
|
117
|
-
|
118
|
-
NODE_LAST,
|
119
|
-
NODE_FILE,
|
116
|
+
NODE_ENCODING,
|
120
117
|
NODE_PREEXE
|
121
118
|
};
|
122
119
|
|
@@ -1,7 +1,4 @@
|
|
1
1
|
node_types = %w[
|
2
|
-
method
|
3
|
-
fbody
|
4
|
-
cfunc
|
5
2
|
scope
|
6
3
|
block
|
7
4
|
if
|
@@ -22,13 +19,13 @@ node_types = %w[
|
|
22
19
|
ensure
|
23
20
|
and
|
24
21
|
or
|
25
|
-
not
|
26
22
|
masgn
|
27
23
|
lasgn
|
28
24
|
dasgn
|
29
25
|
dasgn_curr
|
30
26
|
gasgn
|
31
27
|
iasgn
|
28
|
+
iasgn2
|
32
29
|
cdecl
|
33
30
|
cvasgn
|
34
31
|
cvdecl
|
@@ -43,6 +40,7 @@ node_types = %w[
|
|
43
40
|
zsuper
|
44
41
|
array
|
45
42
|
zarray
|
43
|
+
values
|
46
44
|
hash
|
47
45
|
return
|
48
46
|
yield
|
@@ -66,11 +64,13 @@ node_types = %w[
|
|
66
64
|
dregx
|
67
65
|
dregx_once
|
68
66
|
args
|
67
|
+
args_aux
|
68
|
+
opt_arg
|
69
|
+
postarg
|
69
70
|
argscat
|
70
71
|
argspush
|
71
72
|
splat
|
72
73
|
to_ary
|
73
|
-
svalue
|
74
74
|
block_arg
|
75
75
|
block_pass
|
76
76
|
defn
|
@@ -83,35 +83,32 @@ node_types = %w[
|
|
83
83
|
sclass
|
84
84
|
colon2
|
85
85
|
colon3
|
86
|
-
cref
|
87
86
|
dot2
|
88
87
|
dot3
|
89
88
|
flip2
|
90
89
|
flip3
|
91
|
-
attrset
|
92
90
|
self
|
93
91
|
nil
|
94
92
|
true
|
95
93
|
false
|
94
|
+
errinfo
|
96
95
|
defined
|
97
|
-
newline
|
98
96
|
postexe
|
99
|
-
|
97
|
+
alloca
|
100
98
|
bmethod
|
101
99
|
memo
|
102
100
|
ifunc
|
103
101
|
dsym
|
104
102
|
attrasgn
|
103
|
+
prelude
|
104
|
+
lambda
|
105
|
+
optblock
|
106
|
+
last
|
107
|
+
file
|
105
108
|
regex
|
106
|
-
fixnum
|
107
109
|
number
|
108
|
-
hexnum
|
109
|
-
binnum
|
110
|
-
octnum
|
111
110
|
float
|
112
|
-
|
113
|
-
last
|
114
|
-
file
|
111
|
+
encoding
|
115
112
|
preexe
|
116
113
|
]
|
117
114
|
|