prism 0.29.0 → 0.30.0

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -1
  3. data/CONTRIBUTING.md +0 -4
  4. data/README.md +1 -0
  5. data/config.yml +66 -9
  6. data/docs/fuzzing.md +1 -1
  7. data/docs/ripper_translation.md +22 -0
  8. data/ext/prism/api_node.c +30 -12
  9. data/ext/prism/extension.c +107 -372
  10. data/ext/prism/extension.h +1 -1
  11. data/include/prism/ast.h +138 -70
  12. data/include/prism/diagnostic.h +7 -2
  13. data/include/prism/node.h +0 -21
  14. data/include/prism/parser.h +23 -25
  15. data/include/prism/regexp.h +17 -8
  16. data/include/prism/static_literals.h +3 -2
  17. data/include/prism/util/pm_char.h +1 -2
  18. data/include/prism/util/pm_constant_pool.h +0 -8
  19. data/include/prism/util/pm_integer.h +16 -9
  20. data/include/prism/util/pm_string.h +0 -8
  21. data/include/prism/version.h +2 -2
  22. data/include/prism.h +0 -11
  23. data/lib/prism/compiler.rb +3 -0
  24. data/lib/prism/dispatcher.rb +14 -0
  25. data/lib/prism/dot_visitor.rb +22 -3
  26. data/lib/prism/dsl.rb +7 -2
  27. data/lib/prism/ffi.rb +24 -3
  28. data/lib/prism/inspect_visitor.rb +10 -8
  29. data/lib/prism/mutation_compiler.rb +6 -1
  30. data/lib/prism/node.rb +166 -241
  31. data/lib/prism/node_ext.rb +21 -5
  32. data/lib/prism/parse_result/comments.rb +0 -7
  33. data/lib/prism/parse_result/newlines.rb +101 -11
  34. data/lib/prism/parse_result.rb +17 -0
  35. data/lib/prism/reflection.rb +3 -1
  36. data/lib/prism/serialize.rb +80 -67
  37. data/lib/prism/translation/parser/compiler.rb +134 -114
  38. data/lib/prism/translation/parser.rb +6 -1
  39. data/lib/prism/translation/ripper.rb +8 -6
  40. data/lib/prism/translation/ruby_parser.rb +23 -5
  41. data/lib/prism/visitor.rb +3 -0
  42. data/lib/prism.rb +0 -4
  43. data/prism.gemspec +1 -4
  44. data/rbi/prism/node.rbi +63 -6
  45. data/rbi/prism/visitor.rbi +3 -0
  46. data/rbi/prism.rbi +6 -0
  47. data/sig/prism/dsl.rbs +4 -1
  48. data/sig/prism/mutation_compiler.rbs +1 -0
  49. data/sig/prism/node.rbs +28 -4
  50. data/sig/prism/visitor.rbs +1 -0
  51. data/sig/prism.rbs +21 -0
  52. data/src/diagnostic.c +27 -17
  53. data/src/node.c +408 -1666
  54. data/src/prettyprint.c +49 -6
  55. data/src/prism.c +958 -991
  56. data/src/regexp.c +133 -68
  57. data/src/serialize.c +6 -1
  58. data/src/static_literals.c +63 -84
  59. data/src/token_type.c +2 -2
  60. data/src/util/pm_constant_pool.c +0 -8
  61. data/src/util/pm_integer.c +39 -11
  62. data/src/util/pm_string.c +0 -12
  63. data/src/util/pm_strpbrk.c +32 -6
  64. metadata +2 -5
  65. data/include/prism/util/pm_string_list.h +0 -44
  66. data/lib/prism/debug.rb +0 -249
  67. data/src/util/pm_string_list.c +0 -28
@@ -5,10 +5,13 @@
5
5
  module Prism
6
6
  class Node
7
7
  def deprecated(*replacements) # :nodoc:
8
+ location = caller_locations(1, 1)
9
+ location = location[0].label if location
8
10
  suggest = replacements.map { |replacement| "#{self.class}##{replacement}" }
11
+
9
12
  warn(<<~MSG, category: :deprecated)
10
- [deprecation]: #{self.class}##{caller_locations(1, 1)[0].label} is deprecated \
11
- and will be removed in the next major version. Use #{suggest.join("/")} instead.
13
+ [deprecation]: #{self.class}##{location} is deprecated and will be \
14
+ removed in the next major version. Use #{suggest.join("/")} instead.
12
15
  #{(caller(1, 3) || []).join("\n")}
13
16
  MSG
14
17
  end
@@ -103,7 +106,19 @@ module Prism
103
106
  class RationalNode < Node
104
107
  # Returns the value of the node as a Ruby Rational.
105
108
  def value
106
- Rational(numeric.is_a?(IntegerNode) ? numeric.value : slice.chomp("r"))
109
+ Rational(numerator, denominator)
110
+ end
111
+
112
+ # Returns the value of the node as an IntegerNode or a FloatNode. This
113
+ # method is deprecated in favor of #value or #numerator/#denominator.
114
+ def numeric
115
+ deprecated("value", "numerator", "denominator")
116
+
117
+ if denominator == 1
118
+ IntegerNode.new(source, flags, numerator, location.chop)
119
+ else
120
+ FloatNode.new(source, numerator.to_f / denominator, location.chop)
121
+ end
107
122
  end
108
123
  end
109
124
 
@@ -249,9 +264,10 @@ module Prism
249
264
  end
250
265
 
251
266
  posts.each do |param|
252
- if param.is_a?(MultiTargetNode)
267
+ case param
268
+ when MultiTargetNode
253
269
  names << [:req]
254
- elsif param.is_a?(NoKeywordsParameterNode)
270
+ when NoKeywordsParameterNode, KeywordRestParameterNode, ForwardingParameterNode
255
271
  # Invalid syntax, e.g. "def f(**nil, ...)" moves the NoKeywordsParameterNode to posts
256
272
  raise "Invalid syntax"
257
273
  else
@@ -183,12 +183,5 @@ module Prism
183
183
  [preceding, NodeTarget.new(node), following]
184
184
  end
185
185
  end
186
-
187
- private_constant :Comments
188
-
189
- # Attach the list of comments to their respective locations in the tree.
190
- def attach_comments!
191
- Comments.new(self).attach! # steep:ignore
192
- end
193
186
  end
194
187
  end
@@ -17,21 +17,27 @@ module Prism
17
17
  # Note that the logic in this file should be kept in sync with the Java
18
18
  # MarkNewlinesVisitor, since that visitor is responsible for marking the
19
19
  # newlines for JRuby/TruffleRuby.
20
+ #
21
+ # This file is autoloaded only when `mark_newlines!` is called, so the
22
+ # re-opening of the various nodes in this file will only be performed in
23
+ # that case. We do that to avoid storing the extra `@newline` instance
24
+ # variable on every node if we don't need it.
20
25
  class Newlines < Visitor
21
26
  # Create a new Newlines visitor with the given newline offsets.
22
- def initialize(newline_marked)
23
- @newline_marked = newline_marked
27
+ def initialize(lines)
28
+ # @type var lines: Integer
29
+ @lines = Array.new(1 + lines, false)
24
30
  end
25
31
 
26
32
  # Permit block/lambda nodes to mark newlines within themselves.
27
33
  def visit_block_node(node)
28
- old_newline_marked = @newline_marked
29
- @newline_marked = Array.new(old_newline_marked.size, false)
34
+ old_lines = @lines
35
+ @lines = Array.new(old_lines.size, false)
30
36
 
31
37
  begin
32
38
  super(node)
33
39
  ensure
34
- @newline_marked = old_newline_marked
40
+ @lines = old_lines
35
41
  end
36
42
  end
37
43
 
@@ -39,7 +45,7 @@ module Prism
39
45
 
40
46
  # Mark if/unless nodes as newlines.
41
47
  def visit_if_node(node)
42
- node.set_newline_flag(@newline_marked)
48
+ node.newline!(@lines)
43
49
  super(node)
44
50
  end
45
51
 
@@ -48,17 +54,101 @@ module Prism
48
54
  # Permit statements lists to mark newlines within themselves.
49
55
  def visit_statements_node(node)
50
56
  node.body.each do |child|
51
- child.set_newline_flag(@newline_marked)
57
+ child.newline!(@lines)
52
58
  end
53
59
  super(node)
54
60
  end
55
61
  end
62
+ end
63
+
64
+ class Node
65
+ def newline? # :nodoc:
66
+ @newline ? true : false
67
+ end
68
+
69
+ def newline!(lines) # :nodoc:
70
+ line = location.start_line
71
+ unless lines[line]
72
+ lines[line] = true
73
+ @newline = true
74
+ end
75
+ end
76
+ end
77
+
78
+ class BeginNode < Node
79
+ def newline!(lines) # :nodoc:
80
+ # Never mark BeginNode with a newline flag, mark children instead.
81
+ end
82
+ end
83
+
84
+ class ParenthesesNode < Node
85
+ def newline!(lines) # :nodoc:
86
+ # Never mark ParenthesesNode with a newline flag, mark children instead.
87
+ end
88
+ end
89
+
90
+ class IfNode < Node
91
+ def newline!(lines) # :nodoc:
92
+ predicate.newline!(lines)
93
+ end
94
+ end
95
+
96
+ class UnlessNode < Node
97
+ def newline!(lines) # :nodoc:
98
+ predicate.newline!(lines)
99
+ end
100
+ end
101
+
102
+ class UntilNode < Node
103
+ def newline!(lines) # :nodoc:
104
+ predicate.newline!(lines)
105
+ end
106
+ end
107
+
108
+ class WhileNode < Node
109
+ def newline!(lines) # :nodoc:
110
+ predicate.newline!(lines)
111
+ end
112
+ end
113
+
114
+ class RescueModifierNode < Node
115
+ def newline!(lines) # :nodoc:
116
+ expression.newline!(lines)
117
+ end
118
+ end
119
+
120
+ class InterpolatedMatchLastLineNode < Node
121
+ def newline!(lines) # :nodoc:
122
+ first = parts.first
123
+ first.newline!(lines) if first
124
+ end
125
+ end
126
+
127
+ class InterpolatedRegularExpressionNode < Node
128
+ def newline!(lines) # :nodoc:
129
+ first = parts.first
130
+ first.newline!(lines) if first
131
+ end
132
+ end
133
+
134
+ class InterpolatedStringNode < Node
135
+ def newline!(lines) # :nodoc:
136
+ first = parts.first
137
+ first.newline!(lines) if first
138
+ end
139
+ end
56
140
 
57
- private_constant :Newlines
141
+ class InterpolatedSymbolNode < Node
142
+ def newline!(lines) # :nodoc:
143
+ first = parts.first
144
+ first.newline!(lines) if first
145
+ end
146
+ end
58
147
 
59
- # Walk the tree and mark nodes that are on a new line.
60
- def mark_newlines!
61
- value.accept(Newlines.new(Array.new(1 + source.offsets.size, false))) # steep:ignore
148
+ class InterpolatedXStringNode < Node
149
+ def newline!(lines) # :nodoc:
150
+ first = parts.first
151
+ first.newline!(lines) if first
62
152
  end
63
153
  end
64
154
  end
@@ -574,6 +574,12 @@ module Prism
574
574
 
575
575
  # This is a result specific to the `parse` and `parse_file` methods.
576
576
  class ParseResult < Result
577
+ autoload :Comments, "prism/parse_result/comments"
578
+ autoload :Newlines, "prism/parse_result/newlines"
579
+
580
+ private_constant :Comments
581
+ private_constant :Newlines
582
+
577
583
  # The syntax tree that was parsed from the source code.
578
584
  attr_reader :value
579
585
 
@@ -587,6 +593,17 @@ module Prism
587
593
  def deconstruct_keys(keys)
588
594
  super.merge!(value: value)
589
595
  end
596
+
597
+ # Attach the list of comments to their respective locations in the tree.
598
+ def attach_comments!
599
+ Comments.new(self).attach! # steep:ignore
600
+ end
601
+
602
+ # Walk the tree and mark nodes that are on a new line, loosely emulating
603
+ # the behavior of CRuby's `:line` tracepoint event.
604
+ def mark_newlines!
605
+ value.accept(Newlines.new(source.offsets.size)) # steep:ignore
606
+ end
590
607
  end
591
608
 
592
609
  # This is a result specific to the `lex` and `lex_file` methods.
@@ -277,6 +277,8 @@ module Prism
277
277
  [OptionalLocationField.new(:opening_loc), NodeListField.new(:parts), OptionalLocationField.new(:closing_loc)]
278
278
  when :interpolated_x_string_node
279
279
  [LocationField.new(:opening_loc), NodeListField.new(:parts), LocationField.new(:closing_loc)]
280
+ when :it_local_variable_read_node
281
+ []
280
282
  when :it_parameters_node
281
283
  []
282
284
  when :keyword_hash_node
@@ -346,7 +348,7 @@ module Prism
346
348
  when :range_node
347
349
  [FlagsField.new(:flags, [:exclude_end?]), OptionalNodeField.new(:left), OptionalNodeField.new(:right), LocationField.new(:operator_loc)]
348
350
  when :rational_node
349
- [NodeField.new(:numeric)]
351
+ [FlagsField.new(:flags, [:binary?, :decimal?, :octal?, :hexadecimal?]), IntegerField.new(:numerator), IntegerField.new(:denominator)]
350
352
  when :redo_node
351
353
  []
352
354
  when :regular_expression_node
@@ -18,7 +18,7 @@ module Prism
18
18
 
19
19
  # The minor version of prism that we are expecting to find in the serialized
20
20
  # strings.
21
- MINOR_VERSION = 29
21
+ MINOR_VERSION = 30
22
22
 
23
23
  # The patch version of prism that we are expecting to find in the serialized
24
24
  # strings.
@@ -240,6 +240,7 @@ module Prism
240
240
  :expression_not_writable_file,
241
241
  :expression_not_writable_line,
242
242
  :expression_not_writable_nil,
243
+ :expression_not_writable_numbered,
243
244
  :expression_not_writable_self,
244
245
  :expression_not_writable_true,
245
246
  :float_parse,
@@ -279,6 +280,7 @@ module Prism
279
280
  :invalid_number_underscore_inner,
280
281
  :invalid_number_underscore_trailing,
281
282
  :invalid_percent,
283
+ :invalid_percent_eof,
282
284
  :invalid_printable_character,
283
285
  :invalid_retry_after_else,
284
286
  :invalid_retry_after_ensure,
@@ -310,9 +312,10 @@ module Prism
310
312
  :no_local_variable,
311
313
  :not_expression,
312
314
  :number_literal_underscore,
315
+ :numbered_parameter_inner_block,
313
316
  :numbered_parameter_it,
314
317
  :numbered_parameter_ordinary,
315
- :numbered_parameter_outer_scope,
318
+ :numbered_parameter_outer_block,
316
319
  :operator_multi_assign,
317
320
  :operator_write_arguments,
318
321
  :operator_write_block,
@@ -329,8 +332,8 @@ module Prism
329
332
  :parameter_splat_multi,
330
333
  :parameter_star,
331
334
  :parameter_unexpected_fwd,
332
- :parameter_wild_loose_comma,
333
335
  :parameter_unexpected_no_kw,
336
+ :parameter_wild_loose_comma,
334
337
  :pattern_capture_duplicate,
335
338
  :pattern_expression_after_bracket,
336
339
  :pattern_expression_after_comma,
@@ -359,6 +362,7 @@ module Prism
359
362
  :regexp_incompat_char_encoding,
360
363
  :regexp_invalid_unicode_range,
361
364
  :regexp_non_escaped_mbc,
365
+ :regexp_parse_error,
362
366
  :regexp_term,
363
367
  :regexp_unknown_options,
364
368
  :regexp_utf8_char_non_utf8_regexp,
@@ -398,6 +402,7 @@ module Prism
398
402
  :write_target_readonly,
399
403
  :write_target_unexpected,
400
404
  :xstring_term,
405
+ :ambiguous_binary_operator,
401
406
  :ambiguous_first_argument_minus,
402
407
  :ambiguous_first_argument_plus,
403
408
  :ambiguous_prefix_ampersand,
@@ -891,192 +896,195 @@ module Prism
891
896
  InterpolatedXStringNode.new(
892
897
  source, load_location, Array.new(load_varuint) { load_node }, load_location, location)
893
898
  when 88 then
894
- ItParametersNode.new(
899
+ ItLocalVariableReadNode.new(
895
900
  source, location)
896
901
  when 89 then
902
+ ItParametersNode.new(
903
+ source, location)
904
+ when 90 then
897
905
  KeywordHashNode.new(
898
906
  source, load_varuint, Array.new(load_varuint) { load_node }, location)
899
- when 90 then
907
+ when 91 then
900
908
  KeywordRestParameterNode.new(
901
909
  source, load_varuint, load_optional_constant, load_optional_location, load_location, location)
902
- when 91 then
910
+ when 92 then
903
911
  LambdaNode.new(
904
912
  source, Array.new(load_varuint) { load_required_constant }, load_location, load_location, load_location, load_optional_node, load_optional_node, location)
905
- when 92 then
913
+ when 93 then
906
914
  LocalVariableAndWriteNode.new(
907
915
  source, load_location, load_location, load_node, load_required_constant, load_varuint, location)
908
- when 93 then
916
+ when 94 then
909
917
  LocalVariableOperatorWriteNode.new(
910
918
  source, load_location, load_location, load_node, load_required_constant, load_required_constant, load_varuint, location)
911
- when 94 then
919
+ when 95 then
912
920
  LocalVariableOrWriteNode.new(
913
921
  source, load_location, load_location, load_node, load_required_constant, load_varuint, location)
914
- when 95 then
922
+ when 96 then
915
923
  LocalVariableReadNode.new(
916
924
  source, load_required_constant, load_varuint, location)
917
- when 96 then
925
+ when 97 then
918
926
  LocalVariableTargetNode.new(
919
927
  source, load_required_constant, load_varuint, location)
920
- when 97 then
928
+ when 98 then
921
929
  LocalVariableWriteNode.new(
922
930
  source, load_required_constant, load_varuint, load_location, load_node, load_location, location)
923
- when 98 then
931
+ when 99 then
924
932
  MatchLastLineNode.new(
925
933
  source, load_varuint, load_location, load_location, load_location, load_string, location)
926
- when 99 then
934
+ when 100 then
927
935
  MatchPredicateNode.new(
928
936
  source, load_node, load_node, load_location, location)
929
- when 100 then
937
+ when 101 then
930
938
  MatchRequiredNode.new(
931
939
  source, load_node, load_node, load_location, location)
932
- when 101 then
940
+ when 102 then
933
941
  MatchWriteNode.new(
934
942
  source, load_node, Array.new(load_varuint) { load_node }, location)
935
- when 102 then
943
+ when 103 then
936
944
  MissingNode.new(
937
945
  source, location)
938
- when 103 then
946
+ when 104 then
939
947
  ModuleNode.new(
940
948
  source, Array.new(load_varuint) { load_required_constant }, load_location, load_node, load_optional_node, load_location, load_required_constant, location)
941
- when 104 then
949
+ when 105 then
942
950
  MultiTargetNode.new(
943
951
  source, Array.new(load_varuint) { load_node }, load_optional_node, Array.new(load_varuint) { load_node }, load_optional_location, load_optional_location, location)
944
- when 105 then
952
+ when 106 then
945
953
  MultiWriteNode.new(
946
954
  source, Array.new(load_varuint) { load_node }, load_optional_node, Array.new(load_varuint) { load_node }, load_optional_location, load_optional_location, load_location, load_node, location)
947
- when 106 then
955
+ when 107 then
948
956
  NextNode.new(
949
957
  source, load_optional_node, load_location, location)
950
- when 107 then
958
+ when 108 then
951
959
  NilNode.new(
952
960
  source, location)
953
- when 108 then
961
+ when 109 then
954
962
  NoKeywordsParameterNode.new(
955
963
  source, load_location, load_location, location)
956
- when 109 then
964
+ when 110 then
957
965
  NumberedParametersNode.new(
958
966
  source, io.getbyte, location)
959
- when 110 then
967
+ when 111 then
960
968
  NumberedReferenceReadNode.new(
961
969
  source, load_varuint, location)
962
- when 111 then
970
+ when 112 then
963
971
  OptionalKeywordParameterNode.new(
964
972
  source, load_varuint, load_required_constant, load_location, load_node, location)
965
- when 112 then
973
+ when 113 then
966
974
  OptionalParameterNode.new(
967
975
  source, load_varuint, load_required_constant, load_location, load_location, load_node, location)
968
- when 113 then
976
+ when 114 then
969
977
  OrNode.new(
970
978
  source, load_node, load_node, load_location, location)
971
- when 114 then
979
+ when 115 then
972
980
  ParametersNode.new(
973
981
  source, Array.new(load_varuint) { load_node }, Array.new(load_varuint) { load_node }, load_optional_node, Array.new(load_varuint) { load_node }, Array.new(load_varuint) { load_node }, load_optional_node, load_optional_node, location)
974
- when 115 then
982
+ when 116 then
975
983
  ParenthesesNode.new(
976
984
  source, load_optional_node, load_location, load_location, location)
977
- when 116 then
985
+ when 117 then
978
986
  PinnedExpressionNode.new(
979
987
  source, load_node, load_location, load_location, load_location, location)
980
- when 117 then
988
+ when 118 then
981
989
  PinnedVariableNode.new(
982
990
  source, load_node, load_location, location)
983
- when 118 then
991
+ when 119 then
984
992
  PostExecutionNode.new(
985
993
  source, load_optional_node, load_location, load_location, load_location, location)
986
- when 119 then
994
+ when 120 then
987
995
  PreExecutionNode.new(
988
996
  source, load_optional_node, load_location, load_location, load_location, location)
989
- when 120 then
997
+ when 121 then
990
998
  ProgramNode.new(
991
999
  source, Array.new(load_varuint) { load_required_constant }, load_node, location)
992
- when 121 then
1000
+ when 122 then
993
1001
  RangeNode.new(
994
1002
  source, load_varuint, load_optional_node, load_optional_node, load_location, location)
995
- when 122 then
996
- RationalNode.new(
997
- source, load_node, location)
998
1003
  when 123 then
1004
+ RationalNode.new(
1005
+ source, load_varuint, load_integer, load_integer, location)
1006
+ when 124 then
999
1007
  RedoNode.new(
1000
1008
  source, location)
1001
- when 124 then
1009
+ when 125 then
1002
1010
  RegularExpressionNode.new(
1003
1011
  source, load_varuint, load_location, load_location, load_location, load_string, location)
1004
- when 125 then
1012
+ when 126 then
1005
1013
  RequiredKeywordParameterNode.new(
1006
1014
  source, load_varuint, load_required_constant, load_location, location)
1007
- when 126 then
1015
+ when 127 then
1008
1016
  RequiredParameterNode.new(
1009
1017
  source, load_varuint, load_required_constant, location)
1010
- when 127 then
1018
+ when 128 then
1011
1019
  RescueModifierNode.new(
1012
1020
  source, load_node, load_location, load_node, location)
1013
- when 128 then
1021
+ when 129 then
1014
1022
  RescueNode.new(
1015
1023
  source, load_location, Array.new(load_varuint) { load_node }, load_optional_location, load_optional_node, load_optional_node, load_optional_node, location)
1016
- when 129 then
1024
+ when 130 then
1017
1025
  RestParameterNode.new(
1018
1026
  source, load_varuint, load_optional_constant, load_optional_location, load_location, location)
1019
- when 130 then
1027
+ when 131 then
1020
1028
  RetryNode.new(
1021
1029
  source, location)
1022
- when 131 then
1030
+ when 132 then
1023
1031
  ReturnNode.new(
1024
1032
  source, load_varuint, load_location, load_optional_node, location)
1025
- when 132 then
1033
+ when 133 then
1026
1034
  SelfNode.new(
1027
1035
  source, location)
1028
- when 133 then
1036
+ when 134 then
1029
1037
  ShareableConstantNode.new(
1030
1038
  source, load_varuint, load_node, location)
1031
- when 134 then
1039
+ when 135 then
1032
1040
  SingletonClassNode.new(
1033
1041
  source, Array.new(load_varuint) { load_required_constant }, load_location, load_location, load_node, load_optional_node, load_location, location)
1034
- when 135 then
1042
+ when 136 then
1035
1043
  SourceEncodingNode.new(
1036
1044
  source, location)
1037
- when 136 then
1045
+ when 137 then
1038
1046
  SourceFileNode.new(
1039
1047
  source, load_varuint, load_string, location)
1040
- when 137 then
1048
+ when 138 then
1041
1049
  SourceLineNode.new(
1042
1050
  source, location)
1043
- when 138 then
1051
+ when 139 then
1044
1052
  SplatNode.new(
1045
1053
  source, load_location, load_optional_node, location)
1046
- when 139 then
1054
+ when 140 then
1047
1055
  StatementsNode.new(
1048
1056
  source, Array.new(load_varuint) { load_node }, location)
1049
- when 140 then
1057
+ when 141 then
1050
1058
  StringNode.new(
1051
1059
  source, load_varuint, load_optional_location, load_location, load_optional_location, load_string, location)
1052
- when 141 then
1060
+ when 142 then
1053
1061
  SuperNode.new(
1054
1062
  source, load_location, load_optional_location, load_optional_node, load_optional_location, load_optional_node, location)
1055
- when 142 then
1063
+ when 143 then
1056
1064
  SymbolNode.new(
1057
1065
  source, load_varuint, load_optional_location, load_optional_location, load_optional_location, load_string, location)
1058
- when 143 then
1066
+ when 144 then
1059
1067
  TrueNode.new(
1060
1068
  source, location)
1061
- when 144 then
1069
+ when 145 then
1062
1070
  UndefNode.new(
1063
1071
  source, Array.new(load_varuint) { load_node }, load_location, location)
1064
- when 145 then
1072
+ when 146 then
1065
1073
  UnlessNode.new(
1066
1074
  source, load_location, load_node, load_optional_location, load_optional_node, load_optional_node, load_optional_location, location)
1067
- when 146 then
1075
+ when 147 then
1068
1076
  UntilNode.new(
1069
1077
  source, load_varuint, load_location, load_optional_location, load_node, load_optional_node, location)
1070
- when 147 then
1078
+ when 148 then
1071
1079
  WhenNode.new(
1072
1080
  source, load_location, Array.new(load_varuint) { load_node }, load_optional_location, load_optional_node, location)
1073
- when 148 then
1081
+ when 149 then
1074
1082
  WhileNode.new(
1075
1083
  source, load_varuint, load_location, load_optional_location, load_node, load_optional_node, location)
1076
- when 149 then
1084
+ when 150 then
1077
1085
  XStringNode.new(
1078
1086
  source, load_varuint, load_location, load_location, load_location, load_string, location)
1079
- when 150 then
1087
+ when 151 then
1080
1088
  YieldNode.new(
1081
1089
  source, load_location, load_optional_location, load_optional_node, load_optional_location, location)
1082
1090
  end
@@ -1526,6 +1534,11 @@ module Prism
1526
1534
  InterpolatedXStringNode.new(
1527
1535
  source, load_location, Array.new(load_varuint) { load_node }, load_location, location)
1528
1536
  },
1537
+ -> {
1538
+ location = load_location
1539
+ ItLocalVariableReadNode.new(
1540
+ source, location)
1541
+ },
1529
1542
  -> {
1530
1543
  location = load_location
1531
1544
  ItParametersNode.new(
@@ -1699,7 +1712,7 @@ module Prism
1699
1712
  -> {
1700
1713
  location = load_location
1701
1714
  RationalNode.new(
1702
- source, load_node, location)
1715
+ source, load_varuint, load_integer, load_integer, location)
1703
1716
  },
1704
1717
  -> {
1705
1718
  location = load_location