parser 2.7.0.5 → 2.7.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +21 -32
- data/CHANGELOG.md +59 -1
- data/README.md +2 -2
- data/Rakefile +2 -1
- data/doc/AST_FORMAT.md +106 -3
- data/lib/parser.rb +1 -0
- data/lib/parser/all.rb +1 -0
- data/lib/parser/ast/processor.rb +9 -0
- data/lib/parser/builders/default.rb +103 -12
- data/lib/parser/context.rb +1 -0
- data/lib/parser/current.rb +13 -4
- data/lib/parser/diagnostic.rb +1 -1
- data/lib/parser/diagnostic/engine.rb +1 -2
- data/lib/parser/lexer.rl +15 -1
- data/lib/parser/macruby.y +14 -4
- data/lib/parser/messages.rb +15 -0
- data/lib/parser/meta.rb +4 -4
- data/lib/parser/ruby18.y +2 -0
- data/lib/parser/ruby19.y +14 -4
- data/lib/parser/ruby20.y +14 -4
- data/lib/parser/ruby21.y +9 -2
- data/lib/parser/ruby22.y +9 -2
- data/lib/parser/ruby23.y +9 -2
- data/lib/parser/ruby24.y +9 -2
- data/lib/parser/ruby25.y +9 -2
- data/lib/parser/ruby26.y +9 -2
- data/lib/parser/ruby27.y +28 -8
- data/lib/parser/ruby28.y +3043 -0
- data/lib/parser/rubymotion.y +14 -4
- data/lib/parser/runner.rb +26 -2
- data/lib/parser/runner/ruby_rewrite.rb +2 -2
- data/lib/parser/source/buffer.rb +3 -1
- data/lib/parser/source/comment/associator.rb +14 -4
- data/lib/parser/source/map/endless_definition.rb +23 -0
- data/lib/parser/source/range.rb +17 -1
- data/lib/parser/source/tree_rewriter.rb +115 -12
- data/lib/parser/source/tree_rewriter/action.rb +135 -26
- data/lib/parser/tree_rewriter.rb +1 -2
- data/lib/parser/version.rb +1 -1
- data/parser.gemspec +3 -2
- data/test/helper.rb +49 -6
- data/test/parse_helper.rb +27 -23
- data/test/test_ast_processor.rb +32 -0
- data/test/test_base.rb +1 -1
- data/test/test_current.rb +2 -0
- data/test/test_diagnostic.rb +6 -7
- data/test/test_diagnostic_engine.rb +5 -8
- data/test/test_lexer.rb +17 -8
- data/test/test_meta.rb +12 -0
- data/test/test_parser.rb +477 -54
- data/test/test_runner_parse.rb +22 -1
- data/test/test_runner_rewrite.rb +1 -1
- data/test/test_source_buffer.rb +4 -1
- data/test/test_source_comment.rb +2 -2
- data/test/test_source_comment_associator.rb +47 -15
- data/test/test_source_map.rb +1 -2
- data/test/test_source_range.rb +29 -9
- data/test/test_source_rewriter.rb +4 -4
- data/test/test_source_rewriter_action.rb +2 -2
- data/test/test_source_tree_rewriter.rb +201 -13
- metadata +19 -12
data/lib/parser/context.rb
CHANGED
@@ -5,6 +5,7 @@ module Parser
|
|
5
5
|
#
|
6
6
|
# Supported states:
|
7
7
|
# + :class - in the class body (class A; end)
|
8
|
+
# + :module - in the module body (module M; end)
|
8
9
|
# + :sclass - in the singleton class body (class << obj; end)
|
9
10
|
# + :def - in the method body (def m; end)
|
10
11
|
# + :defs - in the singleton method body (def self.m; end)
|
data/lib/parser/current.rb
CHANGED
@@ -48,7 +48,7 @@ module Parser
|
|
48
48
|
CurrentRuby = Ruby23
|
49
49
|
|
50
50
|
when /^2\.4\./
|
51
|
-
current_version = '2.4.
|
51
|
+
current_version = '2.4.10'
|
52
52
|
if RUBY_VERSION != current_version
|
53
53
|
warn_syntax_deviation 'parser/ruby24', current_version
|
54
54
|
end
|
@@ -57,7 +57,7 @@ module Parser
|
|
57
57
|
CurrentRuby = Ruby24
|
58
58
|
|
59
59
|
when /^2\.5\./
|
60
|
-
current_version = '2.5.
|
60
|
+
current_version = '2.5.8'
|
61
61
|
if RUBY_VERSION != current_version
|
62
62
|
warn_syntax_deviation 'parser/ruby25', current_version
|
63
63
|
end
|
@@ -66,7 +66,7 @@ module Parser
|
|
66
66
|
CurrentRuby = Ruby25
|
67
67
|
|
68
68
|
when /^2\.6\./
|
69
|
-
current_version = '2.6.
|
69
|
+
current_version = '2.6.6'
|
70
70
|
if RUBY_VERSION != current_version
|
71
71
|
warn_syntax_deviation 'parser/ruby26', current_version
|
72
72
|
end
|
@@ -75,7 +75,7 @@ module Parser
|
|
75
75
|
CurrentRuby = Ruby26
|
76
76
|
|
77
77
|
when /^2\.7\./
|
78
|
-
current_version = '2.7.
|
78
|
+
current_version = '2.7.1'
|
79
79
|
if RUBY_VERSION != current_version
|
80
80
|
warn_syntax_deviation 'parser/ruby27', current_version
|
81
81
|
end
|
@@ -83,6 +83,15 @@ module Parser
|
|
83
83
|
require 'parser/ruby27'
|
84
84
|
CurrentRuby = Ruby27
|
85
85
|
|
86
|
+
when /^2\.8\./
|
87
|
+
current_version = '2.8.0-dev'
|
88
|
+
if RUBY_VERSION != current_version
|
89
|
+
warn_syntax_deviation 'parser/ruby28', current_version
|
90
|
+
end
|
91
|
+
|
92
|
+
require 'parser/ruby28'
|
93
|
+
CurrentRuby = Ruby28
|
94
|
+
|
86
95
|
else # :nocov:
|
87
96
|
# Keep this in sync with released Ruby.
|
88
97
|
warn_syntax_deviation 'parser/ruby27', '2.7.x'
|
data/lib/parser/diagnostic.rb
CHANGED
@@ -7,8 +7,7 @@ module Parser
|
|
7
7
|
# diagnostics by delegating them to registered consumers.
|
8
8
|
#
|
9
9
|
# @example
|
10
|
-
# buffer = Parser::Source::Buffer.new(__FILE__)
|
11
|
-
# buffer.code = 'foobar'
|
10
|
+
# buffer = Parser::Source::Buffer.new(__FILE__, source: 'foobar')
|
12
11
|
#
|
13
12
|
# consumer = lambda do |diagnostic|
|
14
13
|
# puts diagnostic.message
|
data/lib/parser/lexer.rl
CHANGED
@@ -283,6 +283,13 @@ class Parser::Lexer
|
|
283
283
|
%% write exec;
|
284
284
|
# %
|
285
285
|
|
286
|
+
# Ragel creates a local variable called `testEof` but it doesn't use
|
287
|
+
# it in any assignment. This dead code is here to swallow the warning.
|
288
|
+
# It has no runtime cost because Ruby doesn't produce any instructions from it.
|
289
|
+
if false
|
290
|
+
testEof
|
291
|
+
end
|
292
|
+
|
286
293
|
@p = p
|
287
294
|
|
288
295
|
if @token_queue.any?
|
@@ -2023,7 +2030,14 @@ class Parser::Lexer
|
|
2023
2030
|
|
2024
2031
|
'...'
|
2025
2032
|
=> {
|
2026
|
-
if @version >=
|
2033
|
+
if @version >= 28
|
2034
|
+
if @lambda_stack.any? && @lambda_stack.last + 1 == @paren_nest
|
2035
|
+
# To reject `->(...)` like `->...`
|
2036
|
+
emit(:tDOT3)
|
2037
|
+
else
|
2038
|
+
emit(:tBDOT3)
|
2039
|
+
end
|
2040
|
+
elsif @version >= 27
|
2027
2041
|
emit(:tBDOT3)
|
2028
2042
|
else
|
2029
2043
|
emit(:tDOT3)
|
data/lib/parser/macruby.y
CHANGED
@@ -1042,11 +1042,15 @@ rule
|
|
1042
1042
|
result = @builder.block(val[0],
|
1043
1043
|
begin_t, args, body, end_t)
|
1044
1044
|
}
|
1045
|
-
| tLAMBDA
|
1045
|
+
| tLAMBDA
|
1046
|
+
{
|
1047
|
+
@context.push(:lambda)
|
1048
|
+
}
|
1049
|
+
lambda
|
1046
1050
|
{
|
1047
1051
|
lambda_call = @builder.call_lambda(val[0])
|
1048
1052
|
|
1049
|
-
args, (begin_t, body, end_t) = val[
|
1053
|
+
args, (begin_t, body, end_t) = val[2]
|
1050
1054
|
result = @builder.block(lambda_call,
|
1051
1055
|
begin_t, args, body, end_t)
|
1052
1056
|
}
|
@@ -1160,6 +1164,7 @@ rule
|
|
1160
1164
|
{
|
1161
1165
|
@static_env.extend_static
|
1162
1166
|
@lexer.push_cmdarg
|
1167
|
+
@context.push(:module)
|
1163
1168
|
}
|
1164
1169
|
bodystmt kEND
|
1165
1170
|
{
|
@@ -1172,6 +1177,7 @@ rule
|
|
1172
1177
|
|
1173
1178
|
@lexer.pop_cmdarg
|
1174
1179
|
@static_env.unextend
|
1180
|
+
@context.pop
|
1175
1181
|
}
|
1176
1182
|
| kDEF fname
|
1177
1183
|
{
|
@@ -1453,9 +1459,13 @@ rule
|
|
1453
1459
|
lambda: {
|
1454
1460
|
@static_env.extend_dynamic
|
1455
1461
|
}
|
1456
|
-
f_larglist
|
1462
|
+
f_larglist
|
1463
|
+
{
|
1464
|
+
@context.pop
|
1465
|
+
}
|
1466
|
+
lambda_body
|
1457
1467
|
{
|
1458
|
-
result = [ val[1], val[
|
1468
|
+
result = [ val[1], val[3] ]
|
1459
1469
|
|
1460
1470
|
@static_env.unextend
|
1461
1471
|
}
|
data/lib/parser/messages.rb
CHANGED
@@ -93,4 +93,19 @@ module Parser
|
|
93
93
|
:crossing_insertions => 'the rewriting action on:',
|
94
94
|
:crossing_insertions_conflict => 'is crossing that on:',
|
95
95
|
}.freeze
|
96
|
+
|
97
|
+
# @api private
|
98
|
+
module Messages
|
99
|
+
# Formats the message, returns a raw template if there's nothing to interpolate
|
100
|
+
#
|
101
|
+
# Code like `format("", {})` gives a warning, and so this method tries interpolating
|
102
|
+
# only if `arguments` hash is not empty.
|
103
|
+
#
|
104
|
+
# @api private
|
105
|
+
def self.compile(reason, arguments)
|
106
|
+
template = MESSAGES[reason]
|
107
|
+
return template if Hash === arguments && arguments.empty?
|
108
|
+
format(template, arguments)
|
109
|
+
end
|
110
|
+
end
|
96
111
|
end
|
data/lib/parser/meta.rb
CHANGED
@@ -12,11 +12,11 @@ module Parser
|
|
12
12
|
sym dsym xstr regopt regexp array splat
|
13
13
|
pair kwsplat hash irange erange self
|
14
14
|
lvar ivar cvar gvar const defined? lvasgn
|
15
|
-
ivasgn cvasgn gvasgn casgn mlhs masgn
|
15
|
+
ivasgn cvasgn gvasgn casgn mlhs masgn rasgn mrasgn
|
16
16
|
op_asgn and_asgn ensure rescue arg_expr
|
17
17
|
or_asgn back_ref nth_ref
|
18
18
|
match_with_lvasgn match_current_line
|
19
|
-
module class sclass def defs undef alias args
|
19
|
+
module class sclass def defs def_e defs_e undef alias args
|
20
20
|
cbase arg optarg restarg blockarg block_pass kwarg kwoptarg
|
21
21
|
kwrestarg kwnilarg send csend super zsuper yield block
|
22
22
|
and not or if when case while until while_post
|
@@ -26,12 +26,12 @@ module Parser
|
|
26
26
|
ident root lambda indexasgn index procarg0
|
27
27
|
restarg_expr blockarg_expr
|
28
28
|
objc_kwarg objc_restarg objc_varargs
|
29
|
-
numargs numblock forward_args forwarded_args
|
29
|
+
numargs numblock forward_args forwarded_args forward_arg
|
30
30
|
case_match in_match in_pattern
|
31
31
|
match_var pin match_alt match_as match_rest
|
32
32
|
array_pattern match_with_trailing_comma array_pattern_with_tail
|
33
33
|
hash_pattern const_pattern if_guard unless_guard match_nil_pattern
|
34
|
-
empty_else
|
34
|
+
empty_else find_pattern
|
35
35
|
).map(&:to_sym).to_set.freeze
|
36
36
|
|
37
37
|
end # Meta
|
data/lib/parser/ruby18.y
CHANGED
@@ -1156,6 +1156,7 @@ rule
|
|
1156
1156
|
| kMODULE cpath
|
1157
1157
|
{
|
1158
1158
|
@static_env.extend_static
|
1159
|
+
@context.push(:module)
|
1159
1160
|
}
|
1160
1161
|
bodystmt kEND
|
1161
1162
|
{
|
@@ -1167,6 +1168,7 @@ rule
|
|
1167
1168
|
val[3], val[4])
|
1168
1169
|
|
1169
1170
|
@static_env.unextend
|
1171
|
+
@context.pop
|
1170
1172
|
}
|
1171
1173
|
| kDEF fname
|
1172
1174
|
{
|
data/lib/parser/ruby19.y
CHANGED
@@ -1009,11 +1009,15 @@ rule
|
|
1009
1009
|
result = @builder.block(val[0],
|
1010
1010
|
begin_t, args, body, end_t)
|
1011
1011
|
}
|
1012
|
-
| tLAMBDA
|
1012
|
+
| tLAMBDA
|
1013
|
+
{
|
1014
|
+
@context.push(:lambda)
|
1015
|
+
}
|
1016
|
+
lambda
|
1013
1017
|
{
|
1014
1018
|
lambda_call = @builder.call_lambda(val[0])
|
1015
1019
|
|
1016
|
-
args, (begin_t, body, end_t) = val[
|
1020
|
+
args, (begin_t, body, end_t) = val[2]
|
1017
1021
|
result = @builder.block(lambda_call,
|
1018
1022
|
begin_t, args, body, end_t)
|
1019
1023
|
}
|
@@ -1127,6 +1131,7 @@ rule
|
|
1127
1131
|
{
|
1128
1132
|
@static_env.extend_static
|
1129
1133
|
@lexer.push_cmdarg
|
1134
|
+
@context.push(:module)
|
1130
1135
|
}
|
1131
1136
|
bodystmt kEND
|
1132
1137
|
{
|
@@ -1139,6 +1144,7 @@ rule
|
|
1139
1144
|
|
1140
1145
|
@lexer.pop_cmdarg
|
1141
1146
|
@static_env.unextend
|
1147
|
+
@context.pop
|
1142
1148
|
}
|
1143
1149
|
| kDEF fname
|
1144
1150
|
{
|
@@ -1433,9 +1439,13 @@ rule
|
|
1433
1439
|
lambda: {
|
1434
1440
|
@static_env.extend_dynamic
|
1435
1441
|
}
|
1436
|
-
f_larglist
|
1442
|
+
f_larglist
|
1443
|
+
{
|
1444
|
+
@context.pop
|
1445
|
+
}
|
1446
|
+
lambda_body
|
1437
1447
|
{
|
1438
|
-
result = [ val[1], val[
|
1448
|
+
result = [ val[1], val[3] ]
|
1439
1449
|
|
1440
1450
|
@static_env.unextend
|
1441
1451
|
}
|
data/lib/parser/ruby20.y
CHANGED
@@ -1039,11 +1039,15 @@ rule
|
|
1039
1039
|
result = @builder.block(val[0],
|
1040
1040
|
begin_t, args, body, end_t)
|
1041
1041
|
}
|
1042
|
-
| tLAMBDA
|
1042
|
+
| tLAMBDA
|
1043
|
+
{
|
1044
|
+
@context.push(:lambda)
|
1045
|
+
}
|
1046
|
+
lambda
|
1043
1047
|
{
|
1044
1048
|
lambda_call = @builder.call_lambda(val[0])
|
1045
1049
|
|
1046
|
-
args, (begin_t, body, end_t) = val[
|
1050
|
+
args, (begin_t, body, end_t) = val[2]
|
1047
1051
|
result = @builder.block(lambda_call,
|
1048
1052
|
begin_t, args, body, end_t)
|
1049
1053
|
}
|
@@ -1157,6 +1161,7 @@ rule
|
|
1157
1161
|
{
|
1158
1162
|
@static_env.extend_static
|
1159
1163
|
@lexer.push_cmdarg
|
1164
|
+
@context.push(:module)
|
1160
1165
|
}
|
1161
1166
|
bodystmt kEND
|
1162
1167
|
{
|
@@ -1169,6 +1174,7 @@ rule
|
|
1169
1174
|
|
1170
1175
|
@lexer.pop_cmdarg
|
1171
1176
|
@static_env.unextend
|
1177
|
+
@context.pop
|
1172
1178
|
}
|
1173
1179
|
| kDEF fname
|
1174
1180
|
{
|
@@ -1487,9 +1493,13 @@ opt_block_args_tail:
|
|
1487
1493
|
lambda: {
|
1488
1494
|
@static_env.extend_dynamic
|
1489
1495
|
}
|
1490
|
-
f_larglist
|
1496
|
+
f_larglist
|
1497
|
+
{
|
1498
|
+
@context.pop
|
1499
|
+
}
|
1500
|
+
lambda_body
|
1491
1501
|
{
|
1492
|
-
result = [ val[1], val[
|
1502
|
+
result = [ val[1], val[3] ]
|
1493
1503
|
|
1494
1504
|
@static_env.unextend
|
1495
1505
|
}
|
data/lib/parser/ruby21.y
CHANGED
@@ -1029,11 +1029,15 @@ rule
|
|
1029
1029
|
result = @builder.block(val[0],
|
1030
1030
|
begin_t, args, body, end_t)
|
1031
1031
|
}
|
1032
|
-
| tLAMBDA
|
1032
|
+
| tLAMBDA
|
1033
|
+
{
|
1034
|
+
@context.push(:lambda)
|
1035
|
+
}
|
1036
|
+
lambda
|
1033
1037
|
{
|
1034
1038
|
lambda_call = @builder.call_lambda(val[0])
|
1035
1039
|
|
1036
|
-
args, (begin_t, body, end_t) = val[
|
1040
|
+
args, (begin_t, body, end_t) = val[2]
|
1037
1041
|
result = @builder.block(lambda_call,
|
1038
1042
|
begin_t, args, body, end_t)
|
1039
1043
|
}
|
@@ -1147,6 +1151,7 @@ rule
|
|
1147
1151
|
{
|
1148
1152
|
@static_env.extend_static
|
1149
1153
|
@lexer.push_cmdarg
|
1154
|
+
@context.push(:module)
|
1150
1155
|
}
|
1151
1156
|
bodystmt kEND
|
1152
1157
|
{
|
@@ -1159,6 +1164,7 @@ rule
|
|
1159
1164
|
|
1160
1165
|
@lexer.pop_cmdarg
|
1161
1166
|
@static_env.unextend
|
1167
|
+
@context.pop
|
1162
1168
|
}
|
1163
1169
|
| kDEF fname
|
1164
1170
|
{
|
@@ -1471,6 +1477,7 @@ opt_block_args_tail:
|
|
1471
1477
|
{
|
1472
1478
|
result = @lexer.cmdarg.dup
|
1473
1479
|
@lexer.cmdarg.clear
|
1480
|
+
@context.pop
|
1474
1481
|
}
|
1475
1482
|
lambda_body
|
1476
1483
|
{
|
data/lib/parser/ruby22.y
CHANGED
@@ -1028,11 +1028,15 @@ rule
|
|
1028
1028
|
result = @builder.block(val[0],
|
1029
1029
|
begin_t, args, body, end_t)
|
1030
1030
|
}
|
1031
|
-
| tLAMBDA
|
1031
|
+
| tLAMBDA
|
1032
|
+
{
|
1033
|
+
@context.push(:lambda)
|
1034
|
+
}
|
1035
|
+
lambda
|
1032
1036
|
{
|
1033
1037
|
lambda_call = @builder.call_lambda(val[0])
|
1034
1038
|
|
1035
|
-
args, (begin_t, body, end_t) = val[
|
1039
|
+
args, (begin_t, body, end_t) = val[2]
|
1036
1040
|
result = @builder.block(lambda_call,
|
1037
1041
|
begin_t, args, body, end_t)
|
1038
1042
|
}
|
@@ -1146,6 +1150,7 @@ rule
|
|
1146
1150
|
{
|
1147
1151
|
@static_env.extend_static
|
1148
1152
|
@lexer.push_cmdarg
|
1153
|
+
@context.push(:module)
|
1149
1154
|
}
|
1150
1155
|
bodystmt kEND
|
1151
1156
|
{
|
@@ -1158,6 +1163,7 @@ rule
|
|
1158
1163
|
|
1159
1164
|
@lexer.pop_cmdarg
|
1160
1165
|
@static_env.unextend
|
1166
|
+
@context.pop
|
1161
1167
|
}
|
1162
1168
|
| kDEF fname
|
1163
1169
|
{
|
@@ -1470,6 +1476,7 @@ opt_block_args_tail:
|
|
1470
1476
|
{
|
1471
1477
|
result = @lexer.cmdarg.dup
|
1472
1478
|
@lexer.cmdarg.clear
|
1479
|
+
@context.pop
|
1473
1480
|
}
|
1474
1481
|
lambda_body
|
1475
1482
|
{
|
data/lib/parser/ruby23.y
CHANGED
@@ -1028,11 +1028,15 @@ rule
|
|
1028
1028
|
result = @builder.block(val[0],
|
1029
1029
|
begin_t, args, body, end_t)
|
1030
1030
|
}
|
1031
|
-
| tLAMBDA
|
1031
|
+
| tLAMBDA
|
1032
|
+
{
|
1033
|
+
@context.push(:lambda)
|
1034
|
+
}
|
1035
|
+
lambda
|
1032
1036
|
{
|
1033
1037
|
lambda_call = @builder.call_lambda(val[0])
|
1034
1038
|
|
1035
|
-
args, (begin_t, body, end_t) = val[
|
1039
|
+
args, (begin_t, body, end_t) = val[2]
|
1036
1040
|
result = @builder.block(lambda_call,
|
1037
1041
|
begin_t, args, body, end_t)
|
1038
1042
|
}
|
@@ -1146,6 +1150,7 @@ rule
|
|
1146
1150
|
{
|
1147
1151
|
@static_env.extend_static
|
1148
1152
|
@lexer.push_cmdarg
|
1153
|
+
@context.push(:module)
|
1149
1154
|
}
|
1150
1155
|
bodystmt kEND
|
1151
1156
|
{
|
@@ -1158,6 +1163,7 @@ rule
|
|
1158
1163
|
|
1159
1164
|
@lexer.pop_cmdarg
|
1160
1165
|
@static_env.unextend
|
1166
|
+
@context.pop
|
1161
1167
|
}
|
1162
1168
|
| kDEF fname
|
1163
1169
|
{
|
@@ -1470,6 +1476,7 @@ opt_block_args_tail:
|
|
1470
1476
|
{
|
1471
1477
|
result = @lexer.cmdarg.dup
|
1472
1478
|
@lexer.cmdarg.clear
|
1479
|
+
@context.pop
|
1473
1480
|
}
|
1474
1481
|
lambda_body
|
1475
1482
|
{
|
data/lib/parser/ruby24.y
CHANGED
@@ -1047,11 +1047,15 @@ rule
|
|
1047
1047
|
result = @builder.block(val[0],
|
1048
1048
|
begin_t, args, body, end_t)
|
1049
1049
|
}
|
1050
|
-
| tLAMBDA
|
1050
|
+
| tLAMBDA
|
1051
|
+
{
|
1052
|
+
@context.push(:lambda)
|
1053
|
+
}
|
1054
|
+
lambda
|
1051
1055
|
{
|
1052
1056
|
lambda_call = @builder.call_lambda(val[0])
|
1053
1057
|
|
1054
|
-
args, (begin_t, body, end_t) = val[
|
1058
|
+
args, (begin_t, body, end_t) = val[2]
|
1055
1059
|
result = @builder.block(lambda_call,
|
1056
1060
|
begin_t, args, body, end_t)
|
1057
1061
|
}
|
@@ -1165,6 +1169,7 @@ rule
|
|
1165
1169
|
{
|
1166
1170
|
@static_env.extend_static
|
1167
1171
|
@lexer.cmdarg.push(false)
|
1172
|
+
@context.push(:module)
|
1168
1173
|
}
|
1169
1174
|
bodystmt kEND
|
1170
1175
|
{
|
@@ -1177,6 +1182,7 @@ rule
|
|
1177
1182
|
|
1178
1183
|
@lexer.cmdarg.pop
|
1179
1184
|
@static_env.unextend
|
1185
|
+
@context.pop
|
1180
1186
|
}
|
1181
1187
|
| kDEF fname
|
1182
1188
|
{
|
@@ -1487,6 +1493,7 @@ opt_block_args_tail:
|
|
1487
1493
|
}
|
1488
1494
|
f_larglist
|
1489
1495
|
{
|
1496
|
+
@context.pop
|
1490
1497
|
@lexer.cmdarg.push(false)
|
1491
1498
|
}
|
1492
1499
|
lambda_body
|