parser 3.2.2.1 → 3.3.10.2

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +2 -1
  3. data/lib/gauntlet_parser.rb +1 -1
  4. data/lib/parser/all.rb +15 -14
  5. data/lib/parser/ast/processor.rb +3 -1
  6. data/lib/parser/base.rb +3 -0
  7. data/lib/parser/builders/default.rb +59 -19
  8. data/lib/parser/context.rb +2 -0
  9. data/lib/parser/current.rb +37 -19
  10. data/lib/parser/lexer/literal.rb +16 -1
  11. data/lib/parser/lexer-F0.rb +360 -299
  12. data/lib/parser/lexer-F1.rb +634 -564
  13. data/lib/parser/lexer-strings.rb +89 -80
  14. data/lib/parser/macruby.rb +5 -3
  15. data/lib/parser/messages.rb +46 -41
  16. data/lib/parser/meta.rb +11 -3
  17. data/lib/parser/ruby18.rb +5 -3
  18. data/lib/parser/ruby19.rb +5 -3
  19. data/lib/parser/ruby20.rb +5 -3
  20. data/lib/parser/ruby21.rb +5 -3
  21. data/lib/parser/ruby22.rb +5 -3
  22. data/lib/parser/ruby23.rb +5 -3
  23. data/lib/parser/ruby24.rb +5 -3
  24. data/lib/parser/ruby25.rb +5 -3
  25. data/lib/parser/ruby26.rb +5 -3
  26. data/lib/parser/ruby27.rb +7 -4
  27. data/lib/parser/ruby30.rb +7 -4
  28. data/lib/parser/ruby31.rb +7 -4
  29. data/lib/parser/ruby32.rb +7 -4
  30. data/lib/parser/ruby33.rb +6766 -6878
  31. data/lib/parser/ruby34.rb +12597 -0
  32. data/lib/parser/rubymotion.rb +5 -3
  33. data/lib/parser/runner/ruby_parse.rb +3 -3
  34. data/lib/parser/runner/ruby_rewrite.rb +1 -1
  35. data/lib/parser/runner.rb +37 -31
  36. data/lib/parser/source/buffer.rb +6 -1
  37. data/lib/parser/source/comment/associator.rb +7 -7
  38. data/lib/parser/source/tree_rewriter/action.rb +5 -4
  39. data/lib/parser/static_environment.rb +56 -9
  40. data/lib/parser/unknown_encoding_in_magic_comment_error.rb +15 -0
  41. data/lib/parser/version.rb +1 -1
  42. data/lib/parser.rb +54 -53
  43. data/parser.gemspec +2 -2
  44. metadata +22 -30
  45. data/lib/parser/ruby28.rb +0 -8047
@@ -21,6 +21,7 @@ module Parser
21
21
  :regexp_options => 'unknown regexp options: %{options}',
22
22
  :cvar_name => "`%{name}' is not allowed as a class variable name",
23
23
  :ivar_name => "`%{name}' is not allowed as an instance variable name",
24
+ :gvar_name => "`%{name}' is not allowed as a global variable name",
24
25
  :trailing_in_number => "trailing `%{character}' in number",
25
26
  :empty_numeric => 'numeric literal without digits',
26
27
  :invalid_octal => 'invalid octal digit',
@@ -40,51 +41,55 @@ module Parser
40
41
  :triple_dot_at_eol => '... at EOL, should be parenthesized',
41
42
 
42
43
  # Parser errors
43
- :nth_ref_alias => 'cannot define an alias for a back-reference variable',
44
- :begin_in_method => 'BEGIN in method',
45
- :backref_assignment => 'cannot assign to a back-reference variable',
46
- :invalid_assignment => 'cannot assign to a keyword',
47
- :module_name_const => 'class or module name must be a constant literal',
48
- :unexpected_token => 'unexpected token %{token}',
49
- :argument_const => 'formal argument cannot be a constant',
50
- :argument_ivar => 'formal argument cannot be an instance variable',
51
- :argument_gvar => 'formal argument cannot be a global variable',
52
- :argument_cvar => 'formal argument cannot be a class variable',
53
- :duplicate_argument => 'duplicate argument name',
54
- :empty_symbol => 'empty symbol literal',
55
- :odd_hash => 'odd number of entries for a hash',
56
- :singleton_literal => 'cannot define a singleton method for a literal',
57
- :dynamic_const => 'dynamic constant assignment',
58
- :const_reassignment => 'constant re-assignment',
59
- :module_in_def => 'module definition in method body',
60
- :class_in_def => 'class definition in method body',
61
- :unexpected_percent_str => '%{type}: unknown type of percent-literal',
62
- :block_and_blockarg => 'both block argument and literal block are passed',
63
- :masgn_as_condition => 'multiple assignment in conditional context',
64
- :block_given_to_yield => 'block given to yield',
65
- :invalid_regexp => '%{message}',
66
- :invalid_return => 'Invalid return in class/module body',
67
- :csend_in_lhs_of_masgn => '&. inside multiple assignment destination',
68
- :cant_assign_to_numparam => 'cannot assign to numbered parameter %{name}',
69
- :reserved_for_numparam => '%{name} is reserved for numbered parameter',
70
- :ordinary_param_defined => 'ordinary parameter is defined',
71
- :numparam_used_in_outer_scope => 'numbered parameter is already used in an outer scope',
72
- :circular_argument_reference => 'circular argument reference %{var_name}',
73
- :pm_interp_in_var_name => 'symbol literal with interpolation is not allowed',
74
- :lvar_name => "`%{name}' is not allowed as a local variable name",
75
- :undefined_lvar => "no such local variable: `%{name}'",
76
- :duplicate_variable_name => 'duplicate variable name %{name}',
77
- :duplicate_pattern_key => 'duplicate hash pattern key %{name}',
78
- :endless_setter => 'setter method cannot be defined in an endless method definition',
79
- :invalid_id_to_get => 'identifier %{identifier} is not valid to get',
80
- :forward_arg_after_restarg => '... after rest argument',
81
- :no_anonymous_blockarg => 'no anonymous block parameter',
82
- :no_anonymous_restarg => 'no anonymous rest parameter',
83
- :no_anonymous_kwrestarg => 'no anonymous keyword rest parameter',
44
+ :nth_ref_alias => 'cannot define an alias for a back-reference variable',
45
+ :begin_in_method => 'BEGIN in method',
46
+ :backref_assignment => 'cannot assign to a back-reference variable',
47
+ :invalid_assignment => 'cannot assign to a keyword',
48
+ :module_name_const => 'class or module name must be a constant literal',
49
+ :unexpected_token => 'unexpected token %{token}',
50
+ :argument_const => 'formal argument cannot be a constant',
51
+ :argument_ivar => 'formal argument cannot be an instance variable',
52
+ :argument_gvar => 'formal argument cannot be a global variable',
53
+ :argument_cvar => 'formal argument cannot be a class variable',
54
+ :duplicate_argument => 'duplicate argument name',
55
+ :empty_symbol => 'empty symbol literal',
56
+ :odd_hash => 'odd number of entries for a hash',
57
+ :singleton_literal => 'cannot define a singleton method for a literal',
58
+ :dynamic_const => 'dynamic constant assignment',
59
+ :const_reassignment => 'constant re-assignment',
60
+ :module_in_def => 'module definition in method body',
61
+ :class_in_def => 'class definition in method body',
62
+ :unexpected_percent_str => '%{type}: unknown type of percent-literal',
63
+ :block_and_blockarg => 'both block argument and literal block are passed',
64
+ :masgn_as_condition => 'multiple assignment in conditional context',
65
+ :block_given_to_yield => 'block given to yield',
66
+ :invalid_regexp => '%{message}',
67
+ :invalid_return => 'Invalid return in class/module body',
68
+ :csend_in_lhs_of_masgn => '&. inside multiple assignment destination',
69
+ :cant_assign_to_numparam => 'cannot assign to numbered parameter %{name}',
70
+ :reserved_for_numparam => '%{name} is reserved for numbered parameter',
71
+ :ordinary_param_defined => 'ordinary parameter is defined',
72
+ :numparam_used_in_outer_scope => 'numbered parameter is already used in an outer scope',
73
+ :circular_argument_reference => 'circular argument reference %{var_name}',
74
+ :pm_interp_in_var_name => 'symbol literal with interpolation is not allowed',
75
+ :lvar_name => "`%{name}' is not allowed as a local variable name",
76
+ :undefined_lvar => "no such local variable: `%{name}'",
77
+ :duplicate_variable_name => 'duplicate variable name %{name}',
78
+ :duplicate_pattern_key => 'duplicate hash pattern key %{name}',
79
+ :endless_setter => 'setter method cannot be defined in an endless method definition',
80
+ :invalid_id_to_get => 'identifier %{identifier} is not valid to get',
81
+ :forward_arg_after_restarg => '... after rest argument',
82
+ :no_anonymous_blockarg => 'no anonymous block parameter',
83
+ :no_anonymous_restarg => 'no anonymous rest parameter',
84
+ :no_anonymous_kwrestarg => 'no anonymous keyword rest parameter',
85
+ :ambiguous_anonymous_restarg => 'anonymous rest parameter is also used within block',
86
+ :ambiguous_anonymous_kwrestarg => 'anonymous keyword rest parameter is also used within block',
87
+ :ambiguous_anonymous_blockarg => 'anonymous block parameter is also used within block',
84
88
 
85
89
  # Parser warnings
86
90
  :useless_else => 'else without rescue is useless',
87
91
  :duplicate_hash_key => 'key is duplicated and overwritten',
92
+ :ambiguous_it_call => '`it` calls without arguments refers to the first block param',
88
93
 
89
94
  # Parser errors that are not Ruby errors
90
95
  :invalid_encoding => 'literal contains escape sequences incompatible with UTF-8',
data/lib/parser/meta.rb CHANGED
@@ -4,9 +4,17 @@ module Parser
4
4
  # Parser metadata
5
5
  module Meta
6
6
 
7
+ # These are node types required by `Prism::Translation::Parser`,
8
+ # which has advanced syntax support ahead of the Parser gem.
9
+ PRISM_TRANSLATION_PARSER_NODE_TYPES = %i(
10
+ itarg itblock blocknilarg
11
+ ).freeze
12
+ private_constant :PRISM_TRANSLATION_PARSER_NODE_TYPES
13
+
7
14
  # All node types that parser can produce. Not all parser versions
8
15
  # will be able to produce every possible node.
9
- NODE_TYPES =
16
+ # Includes node types that are only emitted by the prism parser translator.
17
+ NODE_TYPES = (
10
18
  %i(
11
19
  true false nil int float str dstr
12
20
  sym dsym xstr regopt regexp array splat
@@ -34,7 +42,7 @@ module Parser
34
42
  empty_else find_pattern kwargs
35
43
  match_pattern_p match_pattern
36
44
  forwarded_restarg forwarded_kwrestarg
37
- ).to_set.freeze
38
-
45
+ ) + PRISM_TRANSLATION_PARSER_NODE_TYPES
46
+ ).to_set.freeze
39
47
  end # Meta
40
48
  end # Parser
data/lib/parser/ruby18.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby18.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby18 < Parser::Base
@@ -6272,6 +6272,7 @@ Racc_arg = [
6272
6272
  racc_shift_n,
6273
6273
  racc_reduce_n,
6274
6274
  racc_use_result_var ]
6275
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
6275
6276
 
6276
6277
  Racc_token_to_s_table = [
6277
6278
  "$end",
@@ -6539,6 +6540,7 @@ Racc_token_to_s_table = [
6539
6540
  "restarg_mark",
6540
6541
  "blkarg_mark",
6541
6542
  "assoc" ]
6543
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
6542
6544
 
6543
6545
  Racc_debug_parser = false
6544
6546
 
data/lib/parser/ruby19.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby19.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby19 < Parser::Base
@@ -6215,6 +6215,7 @@ Racc_arg = [
6215
6215
  racc_shift_n,
6216
6216
  racc_reduce_n,
6217
6217
  racc_use_result_var ]
6218
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
6218
6219
 
6219
6220
  Racc_token_to_s_table = [
6220
6221
  "$end",
@@ -6511,6 +6512,7 @@ Racc_token_to_s_table = [
6511
6512
  "restarg_mark",
6512
6513
  "blkarg_mark",
6513
6514
  "assoc" ]
6515
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
6514
6516
 
6515
6517
  Racc_debug_parser = false
6516
6518
 
data/lib/parser/ruby20.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby20.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby20 < Parser::Base
@@ -6630,6 +6630,7 @@ Racc_arg = [
6630
6630
  racc_shift_n,
6631
6631
  racc_reduce_n,
6632
6632
  racc_use_result_var ]
6633
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
6633
6634
 
6634
6635
  Racc_token_to_s_table = [
6635
6636
  "$end",
@@ -6949,6 +6950,7 @@ Racc_token_to_s_table = [
6949
6950
  "restarg_mark",
6950
6951
  "blkarg_mark",
6951
6952
  "assoc" ]
6953
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
6952
6954
 
6953
6955
  Racc_debug_parser = false
6954
6956
 
data/lib/parser/ruby21.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby21.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby21 < Parser::Base
@@ -6583,6 +6583,7 @@ Racc_arg = [
6583
6583
  racc_shift_n,
6584
6584
  racc_reduce_n,
6585
6585
  racc_use_result_var ]
6586
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
6586
6587
 
6587
6588
  Racc_token_to_s_table = [
6588
6589
  "$end",
@@ -6909,6 +6910,7 @@ Racc_token_to_s_table = [
6909
6910
  "restarg_mark",
6910
6911
  "blkarg_mark",
6911
6912
  "assoc" ]
6913
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
6912
6914
 
6913
6915
  Racc_debug_parser = false
6914
6916
 
data/lib/parser/ruby22.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby22.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby22 < Parser::Base
@@ -6668,6 +6668,7 @@ Racc_arg = [
6668
6668
  racc_shift_n,
6669
6669
  racc_reduce_n,
6670
6670
  racc_use_result_var ]
6671
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
6671
6672
 
6672
6673
  Racc_token_to_s_table = [
6673
6674
  "$end",
@@ -6996,6 +6997,7 @@ Racc_token_to_s_table = [
6996
6997
  "restarg_mark",
6997
6998
  "blkarg_mark",
6998
6999
  "assoc" ]
7000
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
6999
7001
 
7000
7002
  Racc_debug_parser = false
7001
7003
 
data/lib/parser/ruby23.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby23.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby23 < Parser::Base
@@ -6678,6 +6678,7 @@ Racc_arg = [
6678
6678
  racc_shift_n,
6679
6679
  racc_reduce_n,
6680
6680
  racc_use_result_var ]
6681
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
6681
6682
 
6682
6683
  Racc_token_to_s_table = [
6683
6684
  "$end",
@@ -7008,6 +7009,7 @@ Racc_token_to_s_table = [
7008
7009
  "restarg_mark",
7009
7010
  "blkarg_mark",
7010
7011
  "assoc" ]
7012
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
7011
7013
 
7012
7014
  Racc_debug_parser = false
7013
7015
 
data/lib/parser/ruby24.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby24.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby24 < Parser::Base
@@ -6758,6 +6758,7 @@ Racc_arg = [
6758
6758
  racc_shift_n,
6759
6759
  racc_reduce_n,
6760
6760
  racc_use_result_var ]
6761
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
6761
6762
 
6762
6763
  Racc_token_to_s_table = [
6763
6764
  "$end",
@@ -7094,6 +7095,7 @@ Racc_token_to_s_table = [
7094
7095
  "restarg_mark",
7095
7096
  "blkarg_mark",
7096
7097
  "assoc" ]
7098
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
7097
7099
 
7098
7100
  Racc_debug_parser = false
7099
7101
 
data/lib/parser/ruby25.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby25.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby25 < Parser::Base
@@ -6693,6 +6693,7 @@ Racc_arg = [
6693
6693
  racc_shift_n,
6694
6694
  racc_reduce_n,
6695
6695
  racc_use_result_var ]
6696
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
6696
6697
 
6697
6698
  Racc_token_to_s_table = [
6698
6699
  "$end",
@@ -7029,6 +7030,7 @@ Racc_token_to_s_table = [
7029
7030
  "restarg_mark",
7030
7031
  "blkarg_mark",
7031
7032
  "assoc" ]
7033
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
7032
7034
 
7033
7035
  Racc_debug_parser = false
7034
7036
 
data/lib/parser/ruby26.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby26.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby26 < Parser::Base
@@ -6652,6 +6652,7 @@ Racc_arg = [
6652
6652
  racc_shift_n,
6653
6653
  racc_reduce_n,
6654
6654
  racc_use_result_var ]
6655
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
6655
6656
 
6656
6657
  Racc_token_to_s_table = [
6657
6658
  "$end",
@@ -6989,6 +6990,7 @@ Racc_token_to_s_table = [
6989
6990
  "restarg_mark",
6990
6991
  "blkarg_mark",
6991
6992
  "assoc" ]
6993
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
6992
6994
 
6993
6995
  Racc_debug_parser = false
6994
6996
 
data/lib/parser/ruby27.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby27.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby27 < Parser::Base
@@ -7519,6 +7519,7 @@ Racc_arg = [
7519
7519
  racc_shift_n,
7520
7520
  racc_reduce_n,
7521
7521
  racc_use_result_var ]
7522
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
7522
7523
 
7523
7524
  Racc_token_to_s_table = [
7524
7525
  "$end",
@@ -7896,6 +7897,7 @@ Racc_token_to_s_table = [
7896
7897
  "restarg_mark",
7897
7898
  "blkarg_mark",
7898
7899
  "assoc" ]
7900
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
7899
7901
 
7900
7902
  Racc_debug_parser = false
7901
7903
 
@@ -10869,11 +10871,12 @@ end
10869
10871
 
10870
10872
  def _reduce_527(val, _values, result)
10871
10873
  name = val[1][0]
10874
+ lvar = @builder.accessible(@builder.ident(val[1]))
10875
+
10872
10876
  unless static_env.declared?(name)
10873
10877
  diagnostic :error, :undefined_lvar, { :name => name }, val[1]
10874
10878
  end
10875
10879
 
10876
- lvar = @builder.accessible(@builder.ident(val[1]))
10877
10880
  result = @builder.pin(val[0], lvar)
10878
10881
 
10879
10882
  result
data/lib/parser/ruby30.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby30.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby30 < Parser::Base
@@ -7727,6 +7727,7 @@ Racc_arg = [
7727
7727
  racc_shift_n,
7728
7728
  racc_reduce_n,
7729
7729
  racc_use_result_var ]
7730
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
7730
7731
 
7731
7732
  Racc_token_to_s_table = [
7732
7733
  "$end",
@@ -8110,6 +8111,7 @@ Racc_token_to_s_table = [
8110
8111
  "restarg_mark",
8111
8112
  "blkarg_mark",
8112
8113
  "assoc" ]
8114
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
8113
8115
 
8114
8116
  Racc_debug_parser = false
8115
8117
 
@@ -11160,11 +11162,12 @@ end
11160
11162
 
11161
11163
  def _reduce_538(val, _values, result)
11162
11164
  name = val[1][0]
11165
+ lvar = @builder.accessible(@builder.ident(val[1]))
11166
+
11163
11167
  unless static_env.declared?(name)
11164
11168
  diagnostic :error, :undefined_lvar, { :name => name }, val[1]
11165
11169
  end
11166
11170
 
11167
- lvar = @builder.accessible(@builder.ident(val[1]))
11168
11171
  result = @builder.pin(val[0], lvar)
11169
11172
 
11170
11173
  result
data/lib/parser/ruby31.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby31.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby31 < Parser::Base
@@ -8034,6 +8034,7 @@ Racc_arg = [
8034
8034
  racc_shift_n,
8035
8035
  racc_reduce_n,
8036
8036
  racc_use_result_var ]
8037
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
8037
8038
 
8038
8039
  Racc_token_to_s_table = [
8039
8040
  "$end",
@@ -8423,6 +8424,7 @@ Racc_token_to_s_table = [
8423
8424
  "restarg_mark",
8424
8425
  "blkarg_mark",
8425
8426
  "assoc" ]
8427
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
8426
8428
 
8427
8429
  Racc_debug_parser = false
8428
8430
 
@@ -11587,11 +11589,12 @@ end
11587
11589
 
11588
11590
  def _reduce_548(val, _values, result)
11589
11591
  name = val[1][0]
11592
+ lvar = @builder.accessible(@builder.ident(val[1]))
11593
+
11590
11594
  unless static_env.declared?(name)
11591
11595
  diagnostic :error, :undefined_lvar, { :name => name }, val[1]
11592
11596
  end
11593
11597
 
11594
- lvar = @builder.accessible(@builder.ident(val[1]))
11595
11598
  result = @builder.pin(val[0], lvar)
11596
11599
 
11597
11600
  result
data/lib/parser/ruby32.rb CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding:utf-8; warn-indent:false; frozen_string_literal: true -*-
2
2
  #
3
3
  # DO NOT MODIFY!!!!
4
- # This file is automatically generated by Racc 1.6.2
5
- # from Racc grammar file "".
4
+ # This file is automatically generated by Racc 1.8.1
5
+ # from Racc grammar file "ruby32.y".
6
6
  #
7
7
 
8
8
  require 'racc/parser.rb'
9
9
 
10
10
 
11
- require 'parser'
11
+ require_relative '../parser'
12
12
 
13
13
  module Parser
14
14
  class Ruby32 < Parser::Base
@@ -8020,6 +8020,7 @@ Racc_arg = [
8020
8020
  racc_shift_n,
8021
8021
  racc_reduce_n,
8022
8022
  racc_use_result_var ]
8023
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
8023
8024
 
8024
8025
  Racc_token_to_s_table = [
8025
8026
  "$end",
@@ -8409,6 +8410,7 @@ Racc_token_to_s_table = [
8409
8410
  "restarg_mark",
8410
8411
  "blkarg_mark",
8411
8412
  "assoc" ]
8413
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
8412
8414
 
8413
8415
  Racc_debug_parser = false
8414
8416
 
@@ -11583,11 +11585,12 @@ end
11583
11585
 
11584
11586
  def _reduce_548(val, _values, result)
11585
11587
  name = val[1][0]
11588
+ lvar = @builder.accessible(@builder.ident(val[1]))
11589
+
11586
11590
  unless static_env.declared?(name)
11587
11591
  diagnostic :error, :undefined_lvar, { :name => name }, val[1]
11588
11592
  end
11589
11593
 
11590
- lvar = @builder.accessible(@builder.ident(val[1]))
11591
11594
  result = @builder.pin(val[0], lvar)
11592
11595
 
11593
11596
  result