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
data/lib/parser/ruby30.rb
CHANGED
@@ -11162,11 +11162,12 @@ end
|
|
11162
11162
|
|
11163
11163
|
def _reduce_538(val, _values, result)
|
11164
11164
|
name = val[1][0]
|
11165
|
+
lvar = @builder.accessible(@builder.ident(val[1]))
|
11166
|
+
|
11165
11167
|
unless static_env.declared?(name)
|
11166
11168
|
diagnostic :error, :undefined_lvar, { :name => name }, val[1]
|
11167
11169
|
end
|
11168
11170
|
|
11169
|
-
lvar = @builder.accessible(@builder.ident(val[1]))
|
11170
11171
|
result = @builder.pin(val[0], lvar)
|
11171
11172
|
|
11172
11173
|
result
|
data/lib/parser/ruby31.rb
CHANGED
@@ -11589,11 +11589,12 @@ end
|
|
11589
11589
|
|
11590
11590
|
def _reduce_548(val, _values, result)
|
11591
11591
|
name = val[1][0]
|
11592
|
+
lvar = @builder.accessible(@builder.ident(val[1]))
|
11593
|
+
|
11592
11594
|
unless static_env.declared?(name)
|
11593
11595
|
diagnostic :error, :undefined_lvar, { :name => name }, val[1]
|
11594
11596
|
end
|
11595
11597
|
|
11596
|
-
lvar = @builder.accessible(@builder.ident(val[1]))
|
11597
11598
|
result = @builder.pin(val[0], lvar)
|
11598
11599
|
|
11599
11600
|
result
|
data/lib/parser/ruby32.rb
CHANGED
@@ -11585,11 +11585,12 @@ end
|
|
11585
11585
|
|
11586
11586
|
def _reduce_548(val, _values, result)
|
11587
11587
|
name = val[1][0]
|
11588
|
+
lvar = @builder.accessible(@builder.ident(val[1]))
|
11589
|
+
|
11588
11590
|
unless static_env.declared?(name)
|
11589
11591
|
diagnostic :error, :undefined_lvar, { :name => name }, val[1]
|
11590
11592
|
end
|
11591
11593
|
|
11592
|
-
lvar = @builder.accessible(@builder.ident(val[1]))
|
11593
11594
|
result = @builder.pin(val[0], lvar)
|
11594
11595
|
|
11595
11596
|
result
|
data/lib/parser/ruby33.rb
CHANGED
@@ -11471,11 +11471,12 @@ end
|
|
11471
11471
|
|
11472
11472
|
def _reduce_548(val, _values, result)
|
11473
11473
|
name = val[1][0]
|
11474
|
+
lvar = @builder.accessible(@builder.ident(val[1]))
|
11475
|
+
|
11474
11476
|
unless static_env.declared?(name)
|
11475
11477
|
diagnostic :error, :undefined_lvar, { :name => name }, val[1]
|
11476
11478
|
end
|
11477
11479
|
|
11478
|
-
lvar = @builder.accessible(@builder.ident(val[1]))
|
11479
11480
|
result = @builder.pin(val[0], lvar)
|
11480
11481
|
|
11481
11482
|
result
|
data/lib/parser/ruby34.rb
CHANGED
@@ -8788,6 +8788,7 @@ def _reduce_64(val, _values, result)
|
|
8788
8788
|
|
8789
8789
|
result = [ val[0], @context.dup ]
|
8790
8790
|
@context.in_def = true
|
8791
|
+
@context.cant_return = false
|
8791
8792
|
|
8792
8793
|
result
|
8793
8794
|
end
|
@@ -10209,6 +10210,7 @@ end
|
|
10209
10210
|
|
10210
10211
|
def _reduce_344(val, _values, result)
|
10211
10212
|
@context.in_class = true
|
10213
|
+
@context.cant_return = true
|
10212
10214
|
local_push
|
10213
10215
|
|
10214
10216
|
result
|
@@ -10226,6 +10228,7 @@ def _reduce_345(val, _values, result)
|
|
10226
10228
|
|
10227
10229
|
local_pop
|
10228
10230
|
@context.in_class = ctx.in_class
|
10231
|
+
@context.cant_return = ctx.cant_return
|
10229
10232
|
|
10230
10233
|
result
|
10231
10234
|
end
|
@@ -10233,6 +10236,7 @@ end
|
|
10233
10236
|
def _reduce_346(val, _values, result)
|
10234
10237
|
@context.in_def = false
|
10235
10238
|
@context.in_class = false
|
10239
|
+
@context.cant_return = true
|
10236
10240
|
local_push
|
10237
10241
|
|
10238
10242
|
result
|
@@ -10246,12 +10250,14 @@ def _reduce_347(val, _values, result)
|
|
10246
10250
|
local_pop
|
10247
10251
|
@context.in_def = ctx.in_def
|
10248
10252
|
@context.in_class = ctx.in_class
|
10253
|
+
@context.cant_return = ctx.cant_return
|
10249
10254
|
|
10250
10255
|
result
|
10251
10256
|
end
|
10252
10257
|
|
10253
10258
|
def _reduce_348(val, _values, result)
|
10254
10259
|
@context.in_class = true
|
10260
|
+
@context.cant_return = true
|
10255
10261
|
local_push
|
10256
10262
|
|
10257
10263
|
result
|
@@ -10267,6 +10273,7 @@ def _reduce_349(val, _values, result)
|
|
10267
10273
|
|
10268
10274
|
local_pop
|
10269
10275
|
@context.in_class = ctx.in_class
|
10276
|
+
@context.cant_return = ctx.cant_return
|
10270
10277
|
|
10271
10278
|
result
|
10272
10279
|
end
|
@@ -10341,7 +10348,7 @@ def _reduce_359(val, _values, result)
|
|
10341
10348
|
end
|
10342
10349
|
|
10343
10350
|
def _reduce_360(val, _values, result)
|
10344
|
-
if @context.
|
10351
|
+
if @context.cant_return && !(context.in_block || context.in_lambda)
|
10345
10352
|
diagnostic :error, :invalid_return, nil, val[0]
|
10346
10353
|
end
|
10347
10354
|
|
@@ -11471,11 +11478,12 @@ end
|
|
11471
11478
|
|
11472
11479
|
def _reduce_548(val, _values, result)
|
11473
11480
|
name = val[1][0]
|
11481
|
+
lvar = @builder.accessible(@builder.ident(val[1]))
|
11482
|
+
|
11474
11483
|
unless static_env.declared?(name)
|
11475
11484
|
diagnostic :error, :undefined_lvar, { :name => name }, val[1]
|
11476
11485
|
end
|
11477
11486
|
|
11478
|
-
lvar = @builder.accessible(@builder.ident(val[1]))
|
11479
11487
|
result = @builder.pin(val[0], lvar)
|
11480
11488
|
|
11481
11489
|
result
|
data/lib/parser/runner.rb
CHANGED
@@ -242,7 +242,12 @@ module Parser
|
|
242
242
|
|
243
243
|
def process_files
|
244
244
|
@files.each do |filename|
|
245
|
-
source =
|
245
|
+
source = begin
|
246
|
+
File.read(filename).force_encoding(@parser.default_encoding)
|
247
|
+
rescue Errno::EISDIR
|
248
|
+
# Will happen for a folder called `foo.rb`. Just catch this here, it's cheaper than checking every file.
|
249
|
+
next
|
250
|
+
end
|
246
251
|
|
247
252
|
buffer = Parser::Source::Buffer.new(filename)
|
248
253
|
|
data/lib/parser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whitequark
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-31 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: ast
|
@@ -205,7 +204,6 @@ files:
|
|
205
204
|
- lib/parser/ruby25.rb
|
206
205
|
- lib/parser/ruby26.rb
|
207
206
|
- lib/parser/ruby27.rb
|
208
|
-
- lib/parser/ruby28.rb
|
209
207
|
- lib/parser/ruby30.rb
|
210
208
|
- lib/parser/ruby31.rb
|
211
209
|
- lib/parser/ruby32.rb
|
@@ -251,10 +249,9 @@ licenses:
|
|
251
249
|
- MIT
|
252
250
|
metadata:
|
253
251
|
bug_tracker_uri: https://github.com/whitequark/parser/issues
|
254
|
-
changelog_uri: https://github.com/whitequark/parser/blob/v3.3.
|
255
|
-
documentation_uri: https://www.rubydoc.info/gems/parser/3.3.
|
256
|
-
source_code_uri: https://github.com/whitequark/parser/tree/v3.3.
|
257
|
-
post_install_message:
|
252
|
+
changelog_uri: https://github.com/whitequark/parser/blob/v3.3.7.4/CHANGELOG.md
|
253
|
+
documentation_uri: https://www.rubydoc.info/gems/parser/3.3.7.4
|
254
|
+
source_code_uri: https://github.com/whitequark/parser/tree/v3.3.7.4
|
258
255
|
rdoc_options: []
|
259
256
|
require_paths:
|
260
257
|
- lib
|
@@ -269,8 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
266
|
- !ruby/object:Gem::Version
|
270
267
|
version: '0'
|
271
268
|
requirements: []
|
272
|
-
rubygems_version: 3.
|
273
|
-
signing_key:
|
269
|
+
rubygems_version: 3.6.2
|
274
270
|
specification_version: 4
|
275
271
|
summary: A Ruby parser written in pure Ruby.
|
276
272
|
test_files: []
|