parser 3.3.5.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: 9eb046630686391eb9f142fc7d246cde16fbed4e56439b393d3fe0afe9a21db1
4
- data.tar.gz: 7fe34e65b83d77aa819638f9977316a53b9233f71363b1c62aeaa5f03aea7259
3
+ metadata.gz: dd5e6ca52bfa9161331505e6cd3de1ef64c5c8ce74a6c1b35b714368b08e5788
4
+ data.tar.gz: e3a21e476c70f8a8c3404269ecfa9b04c8e30d1736ab6d6228dad931281d3cd4
5
5
  SHA512:
6
- metadata.gz: 78d334c12f70da2a91caab8fd8a7a633780fb49a0a36bc6d21022e840502bf02329f1ba3895548ca737bde870a383cf357b7c1eb7291c439ab8029710e4f63b1
7
- data.tar.gz: d9b1b2c45c28aea4533c6d466e7c60cf36e301a380e127a86552eebe2e949aa993c724754bf35f8cf92f92efa218c82f528ef92575b953d981e2ef7be042dc59
6
+ metadata.gz: b99fd52bd95c339076da89cef07325e18ebff96edaa644a21d4974f98cf668520fc69ca27df6d4498579ee99dd3dd784fb27f9eb0a68759d44df1c462bcfb965
7
+ data.tar.gz: a64068bf553c5f784c657481052c27fb5525fadeb914e791408b43eb55d01ef0ab39b01106e04a7f83234c07fa996d219c3f902204ecbb9f0723f36e43c98bd5
data/LICENSE.txt CHANGED
@@ -1,4 +1,5 @@
1
- Copyright (c) 2013-2016 whitequark <whitequark@whitequark.org>
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
@@ -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)
@@ -102,7 +102,7 @@ module Parser
102
102
  CurrentRuby = Ruby31
103
103
 
104
104
  when /^3\.2\./
105
- current_version = '3.2.5'
105
+ current_version = '3.2.6'
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.5'
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.5.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.5.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-09-04 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.5.0/CHANGELOG.md
255
- documentation_uri: https://www.rubydoc.info/gems/parser/3.3.5.0
256
- source_code_uri: https://github.com/whitequark/parser/tree/v3.3.5.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: