ruby-next-parser 3.1.1.0 → 3.1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parser/ruby-next/lexer.rb +9851 -9862
- data/lib/parser/ruby-next/lexer.rl +9 -9
- data/lib/parser/ruby-next/version.rb +1 -1
- data/lib/parser/rubynext.rb +3814 -3736
- data/lib/parser/rubynext.y +195 -157
- metadata +2 -2
@@ -96,7 +96,7 @@ class Next
|
|
96
96
|
attr_accessor :static_env
|
97
97
|
attr_accessor :force_utf32
|
98
98
|
|
99
|
-
attr_accessor :cond, :cmdarg, :
|
99
|
+
attr_accessor :cond, :cmdarg, :context, :command_start
|
100
100
|
|
101
101
|
attr_accessor :tokens, :comments
|
102
102
|
|
@@ -1443,15 +1443,15 @@ class Next
|
|
1443
1443
|
=> { emit(:tLABEL, tok(@ts, @te - 2), @ts, @te - 1)
|
1444
1444
|
fhold; fnext expr_labelarg; fbreak; };
|
1445
1445
|
|
1446
|
-
'...'
|
1446
|
+
'...'
|
1447
1447
|
=> {
|
1448
|
-
if @version >= 31
|
1449
|
-
emit(:tBDOT3, '...'.freeze
|
1450
|
-
emit(:tNL, "\n".freeze, @te - 1, @te)
|
1448
|
+
if @version >= 31 && @context.in_argdef
|
1449
|
+
emit(:tBDOT3, '...'.freeze)
|
1450
|
+
# emit(:tNL, "\n".freeze, @te - 1, @te)
|
1451
1451
|
fnext expr_end; fbreak;
|
1452
1452
|
else
|
1453
|
-
p -=
|
1454
|
-
|
1453
|
+
p -= 3;
|
1454
|
+
fgoto expr_end;
|
1455
1455
|
end
|
1456
1456
|
};
|
1457
1457
|
|
@@ -2077,7 +2077,7 @@ class Next
|
|
2077
2077
|
else
|
2078
2078
|
emit(:tBDOT3, '...'.freeze, @ts, dots_te)
|
2079
2079
|
|
2080
|
-
if @version >= 31 && followed_by_nl && @context.
|
2080
|
+
if @version >= 31 && followed_by_nl && @context.in_argdef
|
2081
2081
|
emit(:tNL, @te - 1, @te)
|
2082
2082
|
nl_emitted = true
|
2083
2083
|
end
|
@@ -2162,7 +2162,7 @@ class Next
|
|
2162
2162
|
|
2163
2163
|
w_newline
|
2164
2164
|
=> {
|
2165
|
-
if @in_kwarg
|
2165
|
+
if @context.in_kwarg
|
2166
2166
|
fhold; fgoto expr_end;
|
2167
2167
|
else
|
2168
2168
|
fgoto line_begin;
|