parser 3.3.6.0 → 3.3.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d7e7ade0d09748d25d79786b349a37bfc5e6165c6bcb0120f4462c9bb2ce410
4
- data.tar.gz: 27612c02dc6f9dc6f2f1050d4da0c3c8b2f1c651b0d7fb37e4dd91537dfa75e1
3
+ metadata.gz: dd5e6ca52bfa9161331505e6cd3de1ef64c5c8ce74a6c1b35b714368b08e5788
4
+ data.tar.gz: e3a21e476c70f8a8c3404269ecfa9b04c8e30d1736ab6d6228dad931281d3cd4
5
5
  SHA512:
6
- metadata.gz: bea6027601398c6336b05fa44b6d3b3c3beb600d2b72b50941e3736329d9e7a11ec2aa03731ac5566bbcde4d4955cd20c2d457d9575b3d86efd0ef24172c0de3
7
- data.tar.gz: 1b9f74f4cb642be7c96aca22b575d5d327e5a1e035a30c0e5ebc5fadfee2168b7c02445a86420644736bf54ce1580b3cddef746f31f3a152570710e3c41d6733
6
+ metadata.gz: b99fd52bd95c339076da89cef07325e18ebff96edaa644a21d4974f98cf668520fc69ca27df6d4498579ee99dd3dd784fb27f9eb0a68759d44df1c462bcfb965
7
+ data.tar.gz: a64068bf553c5f784c657481052c27fb5525fadeb914e791408b43eb55d01ef0ab39b01106e04a7f83234c07fa996d219c3f902204ecbb9f0723f36e43c98bd5
@@ -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)
@@ -111,7 +111,7 @@ module Parser
111
111
  CurrentRuby = Ruby32
112
112
 
113
113
  when /^3\.3\./
114
- current_version = '3.3.6'
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
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.in_class && !@context.in_def && !(context.in_block || context.in_lambda)
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 = File.read(filename).force_encoding(@parser.default_encoding)
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parser
4
- VERSION = '3.3.6.0'
4
+ VERSION = '3.3.7.0'
5
5
  end
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.6.0
4
+ version: 3.3.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - whitequark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-05 00:00:00.000000000 Z
11
+ date: 2025-01-16 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.6.0/CHANGELOG.md
255
- documentation_uri: https://www.rubydoc.info/gems/parser/3.3.6.0
256
- source_code_uri: https://github.com/whitequark/parser/tree/v3.3.6.0
254
+ changelog_uri: https://github.com/whitequark/parser/blob/v3.3.7.0/CHANGELOG.md
255
+ documentation_uri: https://www.rubydoc.info/gems/parser/3.3.7.0
256
+ source_code_uri: https://github.com/whitequark/parser/tree/v3.3.7.0
257
257
  post_install_message:
258
258
  rdoc_options: []
259
259
  require_paths: