Skip to content

Commit db43cfc

Browse files
committedNov 12, 2013
Rename keyword tokens in lexer to match mri/other impls
1 parent f4ade50 commit db43cfc

File tree

4 files changed

+232
-232
lines changed

4 files changed

+232
-232
lines changed
 

‎lib/opal/parser/grammar.rb

+94-94
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/opal/parser/grammar.y

+97-97
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
class Opal::Parser
22

3-
token CLASS MODULE DEF UNDEF BEGIN RESCUE ENSURE END IF UNLESS
4-
THEN ELSIF ELSE CASE WHEN WHILE UNTIL FOR BREAK NEXT
5-
REDO RETRY IN DO DO_COND DO_BLOCK RETURN YIELD SUPER
6-
SELF NIL TRUE FALSE AND OR NOT IF_MOD UNLESS_MOD WHILE_MOD
7-
UNTIL_MOD RESCUE_MOD ALIAS DEFINED klBEGIN klEND LINE
8-
FILE IDENTIFIER FID GVAR IVAR CONSTANT CVAR NTH_REF
3+
token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
4+
kTHEN kELSIF kELSE kCASE kWHEN kWHILE kUNTIL kFOR kBREAK kNEXT
5+
kREDO kRETRY kIN kDO kDO_COND kDO_BLOCK kRETURN kYIELD kSUPER
6+
kSELF kNIL kTRUE kFALSE kAND kOR kNOT kIF_MOD kUNLESS_MOD kWHILE_MOD
7+
kUNTIL_MOD kRESCUE_MOD kALIAS kDEFINED klBEGIN klEND k__LINE__
8+
k__FILE__ IDENTIFIER FID GVAR IVAR CONSTANT CVAR NTH_REF
99
BACK_REF STRING_CONTENT INTEGER FLOAT REGEXP_END '+@'
1010
'-@' '-@NUM' '**' '<=>' '==' '===' '!=' '>=' '<=' '&&'
1111
'||' '=~' '!~' '.' '..' '...' '[]' '[]=' '<<' '>>'
@@ -14,7 +14,7 @@ token CLASS MODULE DEF UNDEF BEGIN RESCUE ENSURE END IF UNLESS
1414
'~' '%' '/' '+' '-' '<' '>' '|' '!' '^'
1515
LCURLY '}' BACK_REF2 SYMBOL_BEG STRING_BEG XSTRING_BEG REGEXP_BEG
1616
WORDS_BEG AWORDS_BEG STRING_DBEG STRING_DVAR STRING_END STRING
17-
SYMBOL '\\n' '?' ':' ',' SPACE ';' LABEL LAMBDA LAMBEG DO_LAMBDA
17+
SYMBOL '\\n' '?' ':' ',' SPACE ';' LABEL LAMBDA LAMBEG kDO_LAMBDA
1818

1919
prechigh
2020
right '!' '~' '+@'
@@ -31,12 +31,12 @@ prechigh
3131
left '||'
3232
nonassoc '..' '...'
3333
right '?' ':'
34-
left RESCUE_MOD
34+
left kRESCUE_MOD
3535
right '=' OP_ASGN
36-
nonassoc DEFINED
37-
right NOT
38-
left OR AND
39-
nonassoc IF_MOD UNLESS_MOD WHILE_MOD UNTIL_MOD
36+
nonassoc kDEFINED
37+
right kNOT
38+
left kOR kAND
39+
nonassoc kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD
4040
nonassoc tLBRACE_ARG
4141
nonassoc LOWEST
4242
preclow
@@ -83,44 +83,44 @@ stmts:
8383
}
8484

8585
stmt:
86-
ALIAS fitem
86+
kALIAS fitem
8787
{
8888
lexer.lex_state = :expr_fname
8989
}
9090
fitem
9191
{
9292
result = s(:alias, val[1], val[3])
9393
}
94-
| ALIAS GVAR GVAR
94+
| kALIAS GVAR GVAR
9595
{
9696
result = s(:valias, val[1].intern, val[2].intern)
9797
}
98-
| ALIAS GVAR BACK_REF
99-
| ALIAS GVAR NTH_REF
98+
| kALIAS GVAR BACK_REF
99+
| kALIAS GVAR NTH_REF
100100
{
101101
result = s(:valias, val[1].intern, val[2].intern)
102102
}
103-
| UNDEF undef_list
103+
| kUNDEF undef_list
104104
{
105105
result = val[1]
106106
}
107-
| stmt IF_MOD expr_value
107+
| stmt kIF_MOD expr_value
108108
{
109109
result = new_if val[2], val[0], nil
110110
}
111-
| stmt UNLESS_MOD expr_value
111+
| stmt kUNLESS_MOD expr_value
112112
{
113113
result = new_if val[2], nil, val[0]
114114
}
115-
| stmt WHILE_MOD expr_value
115+
| stmt kWHILE_MOD expr_value
116116
{
117117
result = s(:while, val[2], val[0], true)
118118
}
119-
| stmt UNTIL_MOD expr_value
119+
| stmt kUNTIL_MOD expr_value
120120
{
121121
result = s(:until, val[2], val[0], true)
122122
}
123-
| stmt RESCUE_MOD stmt
123+
| stmt kRESCUE_MOD stmt
124124
{
125125
result = s(:rescue_mod, val[0], val[2])
126126
}
@@ -165,17 +165,17 @@ stmt:
165165

166166
expr:
167167
command_call
168-
| expr AND expr
168+
| expr kAND expr
169169
{
170170
result = s(:and, val[0], val[2])
171171
result.line = val[0].line
172172
}
173-
| expr OR expr
173+
| expr kOR expr
174174
{
175175
result = s(:or, val[0], val[2])
176176
result.line = val[0].line
177177
}
178-
| NOT expr
178+
| kNOT expr
179179
{
180180
result = s(:not, val[1])
181181
result.line = val[1].line
@@ -192,19 +192,19 @@ expr_value:
192192
command_call:
193193
command
194194
| block_command
195-
| RETURN call_args
195+
| kRETURN call_args
196196
{
197197
args = val[1]
198198
args = args[1] if args.size == 2
199199
result = s(:return, args)
200200
}
201-
| BREAK call_args
201+
| kBREAK call_args
202202
{
203203
args = val[1]
204204
args = args[1] if args.size == 2
205205
result = s(:break, args)
206206
}
207-
| NEXT call_args
207+
| kNEXT call_args
208208
{
209209
args = val[1]
210210
args = args[1] if args.size == 2
@@ -235,11 +235,11 @@ command:
235235
result = new_call val[0], val[2].intern, val[3]
236236
}
237237
| primary_value '::' operation2 command_args cmd_brace_block
238-
| SUPER command_args
238+
| kSUPER command_args
239239
{
240240
result = new_super val[1]
241241
}
242-
| YIELD command_args
242+
| kYIELD command_args
243243
{
244244
result = new_yield val[1]
245245
}
@@ -428,21 +428,21 @@ op:
428428
| '[]=' | BACK_REF2 | '!' | '!='
429429

430430
reswords:
431-
LINE | FILE | klBEGIN | klEND | ALIAS | AND
432-
| BEGIN | BREAK | CASE | CLASS | DEF | DEFINED
433-
| DO | ELSE | ELSIF | END | ENSURE | FALSE
434-
| FOR | IN | MODULE | NEXT | NIL | NOT
435-
| OR | REDO | RESCUE | RETRY | RETURN | SELF
436-
| SUPER | THEN | TRUE | UNDEF | WHEN | YIELD
437-
| IF_MOD | UNLESS_MOD | WHILE_MOD | UNTIL_MOD | RESCUE_MOD
438-
| IF | WHILE | UNTIL | UNLESS
431+
k__LINE__ | k__FILE__ | klBEGIN | klEND | kALIAS | kAND
432+
| kBEGIN | kBREAK | kCASE | kCLASS | kDEF | kDEFINED
433+
| kDO | kELSE | kELSIF | kEND | kENSURE | kFALSE
434+
| kFOR | kIN | kMODULE | kNEXT | kNIL | kNOT
435+
| kOR | kREDO | kRESCUE | kRETRY | kRETURN | kSELF
436+
| kSUPER | kTHEN | kTRUE | kUNDEF | kWHEN | kYIELD
437+
| kIF_MOD | kUNLESS_MOD | kWHILE_MOD | kUNTIL_MOD | kRESCUE_MOD
438+
| kIF | kWHILE | kUNTIL | kUNLESS
439439

440440
arg:
441441
lhs '=' arg
442442
{
443443
result = new_assign val[0], val[2]
444444
}
445-
| lhs '=' arg RESCUE_MOD arg
445+
| lhs '=' arg kRESCUE_MOD arg
446446
{
447447
result = new_assign val[0], s(:rescue_mod, val[2], val[4])
448448
}
@@ -596,7 +596,7 @@ arg:
596596
result = s(:or, val[0], val[2])
597597
result.line = val[0].line
598598
}
599-
| DEFINED opt_nl arg
599+
| kDEFINED opt_nl arg
600600
{
601601
result = s(:defined, val[2])
602602
}
@@ -756,11 +756,11 @@ primary:
756756
| var_ref
757757
| backref
758758
| FID
759-
| BEGIN
759+
| kBEGIN
760760
{
761761
result = lexer.line
762762
}
763-
bodystmt END
763+
bodystmt kEND
764764
{
765765
result = s(:begin, val[2])
766766
result.line = val[1]
@@ -793,32 +793,32 @@ primary:
793793
{
794794
result = s(:hash, *val[1])
795795
}
796-
| RETURN
796+
| kRETURN
797797
{
798798
result = s(:return)
799799
}
800-
| YIELD '(' call_args ')'
800+
| kYIELD '(' call_args ')'
801801
{
802802
result = new_yield val[2]
803803
}
804-
| YIELD '(' ')'
804+
| kYIELD '(' ')'
805805
{
806806
result = s(:yield)
807807
}
808-
| YIELD
808+
| kYIELD
809809
{
810810
result = s(:yield)
811811
}
812-
| DEFINED opt_nl '(' expr ')'
812+
| kDEFINED opt_nl '(' expr ')'
813813
{
814814
result = s(:defined, val[3])
815815
}
816-
| NOT '(' expr ')'
816+
| kNOT '(' expr ')'
817817
{
818818
result = s(:not, val[2])
819819
result.line = val[2].line
820820
}
821-
| NOT '(' ')'
821+
| kNOT '(' ')'
822822
{
823823
result = s(:not, s(:nil))
824824
}
@@ -837,15 +837,15 @@ primary:
837837
{
838838
result = val[1]
839839
}
840-
| IF expr_value then compstmt if_tail END
840+
| kIF expr_value then compstmt if_tail kEND
841841
{
842842
result = new_if val[1], val[3], val[4]
843843
}
844-
| UNLESS expr_value then compstmt opt_else END
844+
| kUNLESS expr_value then compstmt opt_else kEND
845845
{
846846
result = new_if val[1], val[4], val[3]
847847
}
848-
| WHILE
848+
| kWHILE
849849
{
850850
lexer.cond_push 1
851851
result = lexer.line
@@ -854,12 +854,12 @@ primary:
854854
{
855855
lexer.cond_pop
856856
}
857-
compstmt END
857+
compstmt kEND
858858
{
859859
result = s(:while, val[2], val[5], true)
860860
result.line = val[1]
861861
}
862-
| UNTIL
862+
| kUNTIL
863863
{
864864
lexer.cond_push 1
865865
result = lexer.line
@@ -868,87 +868,87 @@ primary:
868868
{
869869
lexer.cond_pop
870870
}
871-
compstmt END
871+
compstmt kEND
872872
{
873873
result = s(:until, val[2], val[5], true)
874874
result.line = val[1]
875875
}
876-
| CASE expr_value opt_terms case_body END
876+
| kCASE expr_value opt_terms case_body kEND
877877
{
878878
result = s(:case, val[1], *val[3])
879879
result.line = val[1].line
880880
}
881-
| CASE opt_terms case_body END
881+
| kCASE opt_terms case_body kEND
882882
{
883883
result = s(:case, nil, *val[2])
884884
# result.line = val[2].line
885885
}
886-
| CASE opt_terms ELSE compstmt END
886+
| kCASE opt_terms kELSE compstmt kEND
887887
{
888888
result = s(:case, nil, val[3])
889889
# result.line = val[3].line
890890
}
891-
| FOR mlhs IN
891+
| kFOR mlhs kIN
892892
{
893-
result = "this.cond_push(1);"
893+
# ...
894894
}
895895
expr_value do
896896
{
897-
result = "this.cond_pop();"
897+
# ...
898898
}
899-
compstmt END
900-
| CLASS
899+
compstmt kEND
900+
| kCLASS
901901
{
902902
result = lexer.line
903903
}
904904
cpath superclass
905905
{
906906
# ...
907907
}
908-
bodystmt END
908+
bodystmt kEND
909909
{
910910
result = new_class val[2], val[3], val[5]
911911
result.line = val[1]
912912
result.end_line = lexer.line
913913
}
914-
| CLASS '<<'
914+
| kCLASS '<<'
915915
{
916916
result = lexer.line
917917
}
918918
expr term
919919
{
920920
# ...
921921
}
922-
bodystmt END
922+
bodystmt kEND
923923
{
924924
result = new_sclass val[3], val[6]
925925
result.line = val[2]
926926
}
927-
| MODULE
927+
| kMODULE
928928
{
929929
result = lexer.line
930930
}
931931
cpath
932932
{
933933
# ...
934934
}
935-
bodystmt END
935+
bodystmt kEND
936936
{
937937
result = new_module val[2], val[4]
938938
result.line = val[1]
939939
result.end_line = lexer.line
940940
}
941-
| DEF fname
941+
| kDEF fname
942942
{
943943
result = lexer.scope_line
944944
push_scope
945945
}
946-
f_arglist bodystmt END
946+
f_arglist bodystmt kEND
947947
{
948948
result = new_def val[2], nil, val[1], val[3], val[4]
949949
pop_scope
950950
}
951-
| DEF singleton dot_or_colon
951+
| kDEF singleton dot_or_colon
952952
{
953953
lexer.lex_state = :expr_fname
954954
}
@@ -957,38 +957,38 @@ primary:
957957
result = lexer.scope_line
958958
push_scope
959959
}
960-
f_arglist bodystmt END
960+
f_arglist bodystmt kEND
961961
{
962962
result = new_def val[5], val[1], val[4], val[6], val[7]
963963
pop_scope
964964
}
965-
| BREAK
965+
| kBREAK
966966
{
967967
result = s(:break)
968968
}
969-
| NEXT
969+
| kNEXT
970970
{
971971
result = s(:next)
972972
}
973-
| REDO
973+
| kREDO
974974
{
975975
result = s(:redo)
976976
}
977-
| RETRY
977+
| kRETRY
978978

979979
primary_value:
980980
primary
981981

982982
then:
983983
term
984984
| ':'
985-
| THEN
986-
| term THEN
985+
| kTHEN
986+
| term kTHEN
987987

988988
do:
989989
term
990990
| ':'
991-
| DO_COND
991+
| kDO_COND
992992

993993
lambda:
994994
f_larglist lambda_body
@@ -1014,7 +1014,7 @@ lambda_body:
10141014
{
10151015
result = val[1]
10161016
}
1017-
| DO_LAMBDA compstmt END
1017+
| kDO_LAMBDA compstmt kEND
10181018
{
10191019
result = val[1]
10201020
}
@@ -1024,7 +1024,7 @@ if_tail:
10241024
{
10251025
result = val[0]
10261026
}
1027-
| ELSIF
1027+
| kELSIF
10281028
{
10291029
result = lexer.line
10301030
}
@@ -1036,7 +1036,7 @@ if_tail:
10361036

10371037
opt_else:
10381038
none
1039-
| ELSE compstmt
1039+
| kELSE compstmt
10401040
{
10411041
result = val[1]
10421042
}
@@ -1128,12 +1128,12 @@ block_param:
11281128
}
11291129

11301130
do_block:
1131-
DO_BLOCK
1131+
kDO_BLOCK
11321132
{
11331133
push_scope :block
11341134
result = lexer.line
11351135
}
1136-
opt_block_var compstmt END
1136+
opt_block_var compstmt kEND
11371137
{
11381138
result = new_iter val[2], val[3]
11391139
result.line = val[1]
@@ -1170,11 +1170,11 @@ method_call:
11701170
{
11711171
result = new_call val[0], val[2].intern, s(:arglist)
11721172
}
1173-
| SUPER paren_args
1173+
| kSUPER paren_args
11741174
{
11751175
result = new_super val[1]
11761176
}
1177-
| SUPER
1177+
| kSUPER
11781178
{
11791179
result = s(:super, nil)
11801180
}
@@ -1191,20 +1191,20 @@ brace_block:
11911191
result.line = val[1]
11921192
pop_scope
11931193
}
1194-
| DO
1194+
| kDO
11951195
{
11961196
push_scope :block
11971197
result = lexer.line
11981198
}
1199-
opt_block_var compstmt END
1199+
opt_block_var compstmt kEND
12001200
{
12011201
result = new_iter val[2], val[3]
12021202
result.line = val[1]
12031203
pop_scope
12041204
}
12051205

12061206
case_body:
1207-
WHEN
1207+
kWHEN
12081208
{
12091209
result = lexer.line
12101210
}
@@ -1224,7 +1224,7 @@ cases:
12241224
| case_body
12251225

12261226
opt_rescue:
1227-
RESCUE exc_list exc_var then compstmt opt_rescue
1227+
kRESCUE exc_list exc_var then compstmt opt_rescue
12281228
{
12291229
exc = val[1] || s(:array)
12301230
exc << new_assign(val[2], s(:gvar, '$!'.intern)) if val[2]
@@ -1255,7 +1255,7 @@ exc_var:
12551255
}
12561256

12571257
opt_ensure:
1258-
ENSURE compstmt
1258+
kENSURE compstmt
12591259
{
12601260
result = val[1].nil? ? s(:nil) : val[1]
12611261
}
@@ -1472,27 +1472,27 @@ variable:
14721472
{
14731473
result = s(:cvar, val[0].intern)
14741474
}
1475-
| NIL
1475+
| kNIL
14761476
{
14771477
result = s(:nil)
14781478
}
1479-
| SELF
1479+
| kSELF
14801480
{
14811481
result = s(:self)
14821482
}
1483-
| TRUE
1483+
| kTRUE
14841484
{
14851485
result = s(:true)
14861486
}
1487-
| FALSE
1487+
| kFALSE
14881488
{
14891489
result = s(:false)
14901490
}
1491-
| FILE
1491+
| k__FILE__
14921492
{
14931493
result = s(:str, self.file)
14941494
}
1495-
| LINE
1495+
| k__LINE__
14961496
{
14971497
result = s(:int, lexer.line)
14981498
}

‎lib/opal/parser/keywords.rb

+35-35
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,41 @@ def initialize(name, id, state)
1212
end
1313

1414
KEYWORDS = [
15-
["__LINE__", [:LINE, :LINE], :expr_end],
16-
["__FILE__", [:FILE, :FILE], :expr_end],
17-
["alias", [:ALIAS, :ALIAS], :expr_fname],
18-
["and", [:AND, :AND], :expr_beg],
19-
["begin", [:BEGIN, :BEGIN], :expr_beg],
20-
["break", [:BREAK, :BREAK], :expr_mid],
21-
["case", [:CASE, :CASE], :expr_beg],
22-
["class", [:CLASS, :CLASS], :expr_class],
23-
["def", [:DEF, :DEF], :expr_fname],
24-
["defined?", [:DEFINED, :DEFINED], :expr_arg],
25-
["do", [:DO, :DO], :expr_beg],
26-
["else", [:ELSE, :ELSE], :expr_beg],
27-
["elsif", [:ELSIF, :ELSIF], :expr_beg],
28-
["end", [:END, :END], :expr_end],
29-
["ensure", [:ENSURE, :ENSURE], :expr_beg],
30-
["false", [:FALSE, :FALSE], :expr_end],
31-
["if", [:IF, :IF_MOD], :expr_beg],
32-
["module", [:MODULE, :MODULE], :expr_beg],
33-
["nil", [:NIL, :NIL], :expr_end],
34-
["next", [:NEXT, :NEXT], :expr_mid],
35-
["not", [:NOT, :NOT], :expr_beg],
36-
["or", [:OR, :OR], :expr_beg],
37-
["redo", [:REDO, :REDO], :expr_end],
38-
["rescue", [:RESCUE, :RESCUE_MOD], :expr_mid],
39-
["return", [:RETURN, :RETURN], :expr_mid],
40-
["self", [:SELF, :SELF], :expr_end],
41-
["super", [:SUPER, :SUPER], :expr_arg],
42-
["then", [:THEN, :THEN], :expr_beg],
43-
["true", [:TRUE, :TRUE], :expr_end],
44-
["undef", [:UNDEF, :UNDEF], :expr_fname],
45-
["unless", [:UNLESS, :UNLESS_MOD], :expr_beg],
46-
["until", [:UNTIL, :UNTIL_MOD], :expr_beg],
47-
["when", [:WHEN, :WHEN], :expr_beg],
48-
["while", [:WHILE, :WHILE_MOD], :expr_beg],
49-
["yield", [:YIELD, :YIELD], :expr_arg]
15+
["__LINE__", [:k__LINE__, :k__LINE__], :expr_end],
16+
["__FILE__", [:k__FILE__, :k__FILE__], :expr_end],
17+
["alias", [:kALIAS, :kALIAS], :expr_fname],
18+
["and", [:kAND, :kAND], :expr_beg],
19+
["begin", [:kBEGIN, :kBEGIN], :expr_beg],
20+
["break", [:kBREAK, :kBREAK], :expr_mid],
21+
["case", [:kCASE, :kCASE], :expr_beg],
22+
["class", [:kCLASS, :kCLASS], :expr_class],
23+
["def", [:kDEF, :kDEF], :expr_fname],
24+
["defined?", [:kDEFINED, :kDEFINED], :expr_arg],
25+
["do", [:kDO, :kDO], :expr_beg],
26+
["else", [:kELSE, :kELSE], :expr_beg],
27+
["elsif", [:kELSIF, :kELSIF], :expr_beg],
28+
["end", [:kEND, :kEND], :expr_end],
29+
["ensure", [:kENSURE, :kENSURE], :expr_beg],
30+
["false", [:kFALSE, :kFALSE], :expr_end],
31+
["if", [:kIF, :kIF_MOD], :expr_beg],
32+
["module", [:kMODULE, :kMODULE], :expr_beg],
33+
["nil", [:kNIL, :kNIL], :expr_end],
34+
["next", [:kNEXT, :kNEXT], :expr_mid],
35+
["not", [:kNOT, :kNOT], :expr_beg],
36+
["or", [:kOR, :kOR], :expr_beg],
37+
["redo", [:kREDO, :kREDO], :expr_end],
38+
["rescue", [:kRESCUE, :kRESCUE_MOD], :expr_mid],
39+
["return", [:kRETURN, :kRETURN], :expr_mid],
40+
["self", [:kSELF, :kSELF], :expr_end],
41+
["super", [:kSUPER, :kSUPER], :expr_arg],
42+
["then", [:kTHEN, :kTHEN], :expr_beg],
43+
["true", [:kTRUE, :kTRUE], :expr_end],
44+
["undef", [:kUNDEF, :kUNDEF], :expr_fname],
45+
["unless", [:kUNLESS, :kUNLESS_MOD], :expr_beg],
46+
["until", [:kUNTIL, :kUNTIL_MOD], :expr_beg],
47+
["when", [:kWHEN, :kWHEN], :expr_beg],
48+
["while", [:kWHILE, :kWHILE_MOD], :expr_beg],
49+
["yield", [:kYIELD, :kYIELD], :expr_arg]
5050
].map { |decl| KeywordTable.new(*decl) }
5151

5252
def self.map

‎lib/opal/parser/lexer.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def process_identifier(matched, cmd_start)
371371
end
372372

373373
@lex_state = :expr_arg
374-
return :DEFINED, 'defined?'
374+
return :kDEFINED, 'defined?'
375375
end
376376

377377
if matched.end_with? '?', '!'
@@ -411,18 +411,18 @@ def process_identifier(matched, cmd_start)
411411
if @start_of_lambda
412412
@start_of_lambda = false
413413
@lex_state = :expr_beg
414-
return [:DO_LAMBDA, scanner.matched]
414+
return [:kDO_LAMBDA, scanner.matched]
415415
elsif cond?
416416
@lex_state = :expr_beg
417-
return :DO_COND, matched
417+
return :kDO_COND, matched
418418
elsif cmdarg? && @lex_state != :expr_cmdarg
419419
@lex_state = :expr_beg
420-
return :DO_BLOCK, matched
420+
return :kDO_BLOCK, matched
421421
elsif @lex_state == :expr_endarg
422-
return :DO_BLOCK, matched
422+
return :kDO_BLOCK, matched
423423
else
424424
@lex_state = :expr_beg
425-
return :DO, matched
425+
return :kDO, matched
426426
end
427427
else
428428
if old_state == :expr_beg or old_state == :expr_value

0 commit comments

Comments
 (0)
Please sign in to comment.