parser 3.3.5.0 → 3.3.7.1
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/LICENSE.txt +2 -1
- data/lib/parser/context.rb +2 -0
- data/lib/parser/current.rb +3 -3
- data/lib/parser/ruby34.rb +8 -1
- data/lib/parser/runner.rb +6 -1
- data/lib/parser/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ece38bf2cdad9f32ead96d9372d4d63d7baff7b22d49a70bffce4d7b2aa637e7
|
4
|
+
data.tar.gz: 7f9689a8d346c4f8405fd1dd1542ffb8506cfad015b45ca3d8e7efc86ef1d4fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb5bd4efe9ce451616da050814fc2b468925da6416310a697ecaf42906ab9e82ff454dfee2b46903a84946527cad1faa7bdfb9e499fa3e3295500910868961aa
|
7
|
+
data.tar.gz: f826364564639d1604d4a051c31d5df07f192ce2b458e1d2841bf7a2320180a5bdbcca3fb2117b13e00b9961ead1a0a5b073458c321601e581c33aaf2e259ecf
|
data/LICENSE.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
Copyright (c) 2013-
|
1
|
+
Copyright (c) 2013-2024 parser project contributors
|
2
|
+
Copyright (c) 2013-2016 Catherine <whitequark@whitequark.org>
|
2
3
|
|
3
4
|
Parts of the source are derived from ruby_parser:
|
4
5
|
Copyright (c) Ryan Davis, seattle.rb
|
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
@@ -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.7'
|
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
|
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
|
|
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,14 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whitequark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|
@@ -251,9 +251,9 @@ licenses:
|
|
251
251
|
- MIT
|
252
252
|
metadata:
|
253
253
|
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.
|
254
|
+
changelog_uri: https://github.com/whitequark/parser/blob/v3.3.7.1/CHANGELOG.md
|
255
|
+
documentation_uri: https://www.rubydoc.info/gems/parser/3.3.7.1
|
256
|
+
source_code_uri: https://github.com/whitequark/parser/tree/v3.3.7.1
|
257
257
|
post_install_message:
|
258
258
|
rdoc_options: []
|
259
259
|
require_paths:
|