parser 3.3.6.0 → 3.3.7.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/lib/parser/builders/default.rb +21 -8
- data/lib/parser/context.rb +2 -0
- data/lib/parser/current.rb +4 -4
- data/lib/parser/lexer-F0.rb +306 -297
- data/lib/parser/lexer-F1.rb +571 -562
- data/lib/parser/lexer-strings.rb +89 -80
- data/lib/parser/meta.rb +11 -3
- data/lib/parser/ruby27.rb +2 -1
- data/lib/parser/ruby30.rb +2 -1
- data/lib/parser/ruby31.rb +2 -1
- data/lib/parser/ruby32.rb +2 -1
- data/lib/parser/ruby33.rb +2 -1
- data/lib/parser/ruby34.rb +10 -2
- data/lib/parser/runner.rb +6 -1
- data/lib/parser/version.rb +1 -1
- metadata +6 -10
- data/lib/parser/ruby28.rb +0 -8047
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25b417c32007a795266f1f747b0863b4a1c121ee3261cf251b63618469944926
|
4
|
+
data.tar.gz: a191fef9e9a3862c2f062cd9f790fb844486502da486b2755e336c128545dfc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 735028b66a029d6ec460b604a20ace8b640b0783006d504b41ca90c965da2aaf08017ee91d9121ea5780d7862f2a2f311725648b5102ccbaf79dd3ee2f962c6d
|
7
|
+
data.tar.gz: 24461b6d10a3edfd8a9bc56ab7a21e8d1c4ca99dae56114f0134a46b2d0f8b5843d662d876d758d2e59eced666b7dd94e08635c1fb40ae00df054043d9af3aa2
|
@@ -524,10 +524,10 @@ module Parser
|
|
524
524
|
|
525
525
|
label = value(key_t)
|
526
526
|
value =
|
527
|
-
if label =~ /\A[[:
|
528
|
-
n(:ident, [ label.to_sym ], Source::Map::Variable.new(value_l))
|
529
|
-
else
|
527
|
+
if label =~ /\A[[:upper:]]/
|
530
528
|
n(:const, [ nil, label.to_sym ], Source::Map::Constant.new(nil, value_l, value_l))
|
529
|
+
else
|
530
|
+
n(:ident, [ label.to_sym ], Source::Map::Variable.new(value_l))
|
531
531
|
end
|
532
532
|
pair_keyword(key_t, accessible(value))
|
533
533
|
end
|
@@ -1120,15 +1120,19 @@ module Parser
|
|
1120
1120
|
end
|
1121
1121
|
|
1122
1122
|
def block(method_call, begin_t, args, body, end_t)
|
1123
|
-
_receiver, _selector, *call_args = *method_call
|
1124
|
-
|
1125
1123
|
if method_call.type == :yield
|
1126
1124
|
diagnostic :error, :block_given_to_yield, nil, method_call.loc.keyword, [loc(begin_t)]
|
1127
1125
|
end
|
1128
1126
|
|
1129
|
-
|
1127
|
+
if method_call.type == :super
|
1128
|
+
*_args, last_arg = *method_call
|
1129
|
+
else
|
1130
|
+
_receiver, _selector, *_args, last_arg = *method_call
|
1131
|
+
end
|
1130
1132
|
if last_arg && (last_arg.type == :block_pass || last_arg.type == :forwarded_args)
|
1131
|
-
|
1133
|
+
if (@parser.version == 33 && method_call.type != :super) || @parser.version != 33
|
1134
|
+
diagnostic :error, :block_and_blockarg, nil, last_arg.loc.expression, [loc(begin_t)]
|
1135
|
+
end
|
1132
1136
|
end
|
1133
1137
|
|
1134
1138
|
if args.type == :numargs
|
@@ -1192,6 +1196,10 @@ module Parser
|
|
1192
1196
|
end
|
1193
1197
|
|
1194
1198
|
def index_asgn(receiver, lbrack_t, indexes, rbrack_t)
|
1199
|
+
if self.class.emit_kwargs
|
1200
|
+
rewrite_hash_args_to_kwargs(indexes)
|
1201
|
+
end
|
1202
|
+
|
1195
1203
|
if self.class.emit_index
|
1196
1204
|
n(:indexasgn, [ receiver, *indexes ],
|
1197
1205
|
index_map(receiver, lbrack_t, rbrack_t))
|
@@ -2263,7 +2271,12 @@ module Parser
|
|
2263
2271
|
source
|
2264
2272
|
end
|
2265
2273
|
|
2266
|
-
|
2274
|
+
begin
|
2275
|
+
old_verbose, $VERBOSE = $VERBOSE, nil
|
2276
|
+
Regexp.new(source, (Regexp::EXTENDED if options.children.include?(:x)))
|
2277
|
+
ensure
|
2278
|
+
$VERBOSE = old_verbose
|
2279
|
+
end
|
2267
2280
|
end
|
2268
2281
|
|
2269
2282
|
def static_regexp_node(node)
|
data/lib/parser/context.rb
CHANGED
@@ -24,6 +24,7 @@ module Parser
|
|
24
24
|
in_class
|
25
25
|
in_block
|
26
26
|
in_lambda
|
27
|
+
cant_return
|
27
28
|
]
|
28
29
|
|
29
30
|
def initialize
|
@@ -38,6 +39,7 @@ module Parser
|
|
38
39
|
@in_class = false
|
39
40
|
@in_block = false
|
40
41
|
@in_lambda = false
|
42
|
+
@cant_return = false
|
41
43
|
end
|
42
44
|
|
43
45
|
attr_accessor(*FLAGS)
|
data/lib/parser/current.rb
CHANGED
@@ -93,7 +93,7 @@ module Parser
|
|
93
93
|
CurrentRuby = Ruby30
|
94
94
|
|
95
95
|
when /^3\.1\./
|
96
|
-
current_version = '3.1.
|
96
|
+
current_version = '3.1.7'
|
97
97
|
if RUBY_VERSION != current_version
|
98
98
|
warn_syntax_deviation 'parser/ruby31', current_version
|
99
99
|
end
|
@@ -102,7 +102,7 @@ module Parser
|
|
102
102
|
CurrentRuby = Ruby31
|
103
103
|
|
104
104
|
when /^3\.2\./
|
105
|
-
current_version = '3.2.
|
105
|
+
current_version = '3.2.8'
|
106
106
|
if RUBY_VERSION != current_version
|
107
107
|
warn_syntax_deviation 'parser/ruby32', current_version
|
108
108
|
end
|
@@ -111,7 +111,7 @@ module Parser
|
|
111
111
|
CurrentRuby = Ruby32
|
112
112
|
|
113
113
|
when /^3\.3\./
|
114
|
-
current_version = '3.3.
|
114
|
+
current_version = '3.3.7'
|
115
115
|
if RUBY_VERSION != current_version
|
116
116
|
warn_syntax_deviation 'parser/ruby33', current_version
|
117
117
|
end
|
@@ -120,7 +120,7 @@ module Parser
|
|
120
120
|
CurrentRuby = Ruby33
|
121
121
|
|
122
122
|
when /^3\.4\./
|
123
|
-
current_version = '3.4.0'
|
123
|
+
current_version = '3.4.0-dev'
|
124
124
|
if RUBY_VERSION != current_version
|
125
125
|
warn_syntax_deviation 'parser/ruby34', current_version
|
126
126
|
end
|