prism 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -1
  3. data/Makefile +5 -0
  4. data/README.md +8 -6
  5. data/config.yml +236 -38
  6. data/docs/build_system.md +19 -2
  7. data/docs/cruby_compilation.md +27 -0
  8. data/docs/parser_translation.md +34 -0
  9. data/docs/parsing_rules.md +19 -0
  10. data/docs/releasing.md +3 -3
  11. data/docs/ruby_api.md +1 -1
  12. data/docs/serialization.md +17 -5
  13. data/ext/prism/api_node.c +101 -81
  14. data/ext/prism/extension.c +74 -11
  15. data/ext/prism/extension.h +1 -1
  16. data/include/prism/ast.h +1699 -504
  17. data/include/prism/defines.h +8 -0
  18. data/include/prism/diagnostic.h +39 -2
  19. data/include/prism/encoding.h +10 -0
  20. data/include/prism/options.h +40 -14
  21. data/include/prism/parser.h +33 -17
  22. data/include/prism/util/pm_buffer.h +9 -0
  23. data/include/prism/util/pm_constant_pool.h +7 -0
  24. data/include/prism/util/pm_newline_list.h +0 -11
  25. data/include/prism/version.h +2 -2
  26. data/include/prism.h +19 -2
  27. data/lib/prism/debug.rb +11 -5
  28. data/lib/prism/dot_visitor.rb +36 -14
  29. data/lib/prism/dsl.rb +22 -22
  30. data/lib/prism/ffi.rb +2 -2
  31. data/lib/prism/node.rb +1020 -737
  32. data/lib/prism/node_ext.rb +2 -2
  33. data/lib/prism/parse_result.rb +17 -9
  34. data/lib/prism/serialize.rb +53 -29
  35. data/lib/prism/translation/parser/compiler.rb +1831 -0
  36. data/lib/prism/translation/parser/lexer.rb +335 -0
  37. data/lib/prism/translation/parser/rubocop.rb +37 -0
  38. data/lib/prism/translation/parser.rb +163 -0
  39. data/lib/prism/translation.rb +11 -0
  40. data/lib/prism.rb +1 -0
  41. data/prism.gemspec +12 -5
  42. data/rbi/prism.rbi +150 -88
  43. data/rbi/prism_static.rbi +15 -3
  44. data/sig/prism.rbs +996 -961
  45. data/sig/prism_static.rbs +123 -46
  46. data/src/diagnostic.c +259 -219
  47. data/src/encoding.c +4 -8
  48. data/src/node.c +2 -6
  49. data/src/options.c +24 -5
  50. data/src/prettyprint.c +174 -42
  51. data/src/prism.c +1136 -328
  52. data/src/serialize.c +12 -9
  53. data/src/token_type.c +353 -4
  54. data/src/util/pm_buffer.c +11 -0
  55. data/src/util/pm_constant_pool.c +12 -11
  56. data/src/util/pm_newline_list.c +2 -14
  57. metadata +10 -3
  58. data/docs/building.md +0 -29
data/rbi/prism.rbi CHANGED
@@ -196,8 +196,7 @@ class Prism::ArgumentsNode < Prism::Node
196
196
  def inspect(inspector); end
197
197
  end
198
198
 
199
- # Represents an array literal. This can be a regular array using brackets or
200
- # a special array using % like %w or %i.
199
+ # Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i.
201
200
  #
202
201
  # [1, 2, 3]
203
202
  # ^^^^^^^^^
@@ -316,13 +315,13 @@ class Prism::AssocNode < Prism::Node
316
315
  sig { returns(Prism::Node) }
317
316
  def key; end
318
317
 
319
- sig { returns(T.nilable(Prism::Node)) }
318
+ sig { returns(Prism::Node) }
320
319
  def value; end
321
320
 
322
321
  sig { returns(T.nilable(Prism::Location)) }
323
322
  def operator_loc; end
324
323
 
325
- sig { params(key: Prism::Node, value: T.nilable(Prism::Node), operator_loc: T.nilable(Prism::Location), location: Prism::Location).void }
324
+ sig { params(key: Prism::Node, value: Prism::Node, operator_loc: T.nilable(Prism::Location), location: Prism::Location).void }
326
325
  def initialize(key, value, operator_loc, location); end
327
326
 
328
327
  sig { params(visitor: Prism::Visitor).void }
@@ -509,11 +508,14 @@ end
509
508
  # a { |; b| }
510
509
  # ^
511
510
  class Prism::BlockLocalVariableNode < Prism::Node
511
+ sig { returns(Integer) }
512
+ def flags; end
513
+
512
514
  sig { returns(Symbol) }
513
515
  def name; end
514
516
 
515
- sig { params(name: Symbol, location: Prism::Location).void }
516
- def initialize(name, location); end
517
+ sig { params(flags: Integer, name: Symbol, location: Prism::Location).void }
518
+ def initialize(flags, name, location); end
517
519
 
518
520
  sig { params(visitor: Prism::Visitor).void }
519
521
  def accept(visitor); end
@@ -530,21 +532,21 @@ class Prism::BlockLocalVariableNode < Prism::Node
530
532
  sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) }
531
533
  def deconstruct_keys(keys); end
532
534
 
535
+ sig { returns(T::Boolean) }
536
+ def repeated_parameter?; end
537
+
533
538
  sig { params(inspector: Prism::NodeInspector).returns(String) }
534
539
  def inspect(inspector); end
535
540
  end
536
541
 
537
542
  # Represents a block of ruby code.
538
543
  #
539
- # [1, 2, 3].each { |i| puts x }
540
- # ^^^^^^^^^^^^^^
544
+ # [1, 2, 3].each { |i| puts x }
545
+ # ^^^^^^^^^^^^^^
541
546
  class Prism::BlockNode < Prism::Node
542
547
  sig { returns(T::Array[Symbol]) }
543
548
  def locals; end
544
549
 
545
- sig { returns(Integer) }
546
- def locals_body_index; end
547
-
548
550
  sig { returns(T.nilable(Prism::Node)) }
549
551
  def parameters; end
550
552
 
@@ -557,8 +559,8 @@ class Prism::BlockNode < Prism::Node
557
559
  sig { returns(Prism::Location) }
558
560
  def closing_loc; end
559
561
 
560
- sig { params(locals: T::Array[Symbol], locals_body_index: Integer, parameters: T.nilable(Prism::Node), body: T.nilable(Prism::Node), opening_loc: Prism::Location, closing_loc: Prism::Location, location: Prism::Location).void }
561
- def initialize(locals, locals_body_index, parameters, body, opening_loc, closing_loc, location); end
562
+ sig { params(locals: T::Array[Symbol], parameters: T.nilable(Prism::Node), body: T.nilable(Prism::Node), opening_loc: Prism::Location, closing_loc: Prism::Location, location: Prism::Location).void }
563
+ def initialize(locals, parameters, body, opening_loc, closing_loc, location); end
562
564
 
563
565
  sig { params(visitor: Prism::Visitor).void }
564
566
  def accept(visitor); end
@@ -591,6 +593,9 @@ end
591
593
  # ^^
592
594
  # end
593
595
  class Prism::BlockParameterNode < Prism::Node
596
+ sig { returns(Integer) }
597
+ def flags; end
598
+
594
599
  sig { returns(T.nilable(Symbol)) }
595
600
  def name; end
596
601
 
@@ -600,8 +605,8 @@ class Prism::BlockParameterNode < Prism::Node
600
605
  sig { returns(Prism::Location) }
601
606
  def operator_loc; end
602
607
 
603
- sig { params(name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).void }
604
- def initialize(name, name_loc, operator_loc, location); end
608
+ sig { params(flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).void }
609
+ def initialize(flags, name, name_loc, operator_loc, location); end
605
610
 
606
611
  sig { params(visitor: Prism::Visitor).void }
607
612
  def accept(visitor); end
@@ -618,6 +623,9 @@ class Prism::BlockParameterNode < Prism::Node
618
623
  sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) }
619
624
  def deconstruct_keys(keys); end
620
625
 
626
+ sig { returns(T::Boolean) }
627
+ def repeated_parameter?; end
628
+
621
629
  sig { returns(String) }
622
630
  def operator; end
623
631
 
@@ -766,6 +774,9 @@ class Prism::CallAndWriteNode < Prism::Node
766
774
  sig { returns(T::Boolean) }
767
775
  def attribute_write?; end
768
776
 
777
+ sig { returns(T::Boolean) }
778
+ def ignore_visibility?; end
779
+
769
780
  sig { returns(T.nilable(String)) }
770
781
  def call_operator; end
771
782
 
@@ -853,6 +864,9 @@ class Prism::CallNode < Prism::Node
853
864
  sig { returns(T::Boolean) }
854
865
  def attribute_write?; end
855
866
 
867
+ sig { returns(T::Boolean) }
868
+ def ignore_visibility?; end
869
+
856
870
  sig { returns(T.nilable(String)) }
857
871
  def call_operator; end
858
872
 
@@ -928,6 +942,9 @@ class Prism::CallOperatorWriteNode < Prism::Node
928
942
  sig { returns(T::Boolean) }
929
943
  def attribute_write?; end
930
944
 
945
+ sig { returns(T::Boolean) }
946
+ def ignore_visibility?; end
947
+
931
948
  sig { returns(T.nilable(String)) }
932
949
  def call_operator; end
933
950
 
@@ -994,6 +1011,9 @@ class Prism::CallOrWriteNode < Prism::Node
994
1011
  sig { returns(T::Boolean) }
995
1012
  def attribute_write?; end
996
1013
 
1014
+ sig { returns(T::Boolean) }
1015
+ def ignore_visibility?; end
1016
+
997
1017
  sig { returns(T.nilable(String)) }
998
1018
  def call_operator; end
999
1019
 
@@ -1062,6 +1082,9 @@ class Prism::CallTargetNode < Prism::Node
1062
1082
  sig { returns(T::Boolean) }
1063
1083
  def attribute_write?; end
1064
1084
 
1085
+ sig { returns(T::Boolean) }
1086
+ def ignore_visibility?; end
1087
+
1065
1088
  sig { returns(String) }
1066
1089
  def call_operator; end
1067
1090
 
@@ -1991,9 +2014,6 @@ class Prism::DefNode < Prism::Node
1991
2014
  sig { returns(T::Array[Symbol]) }
1992
2015
  def locals; end
1993
2016
 
1994
- sig { returns(Integer) }
1995
- def locals_body_index; end
1996
-
1997
2017
  sig { returns(Prism::Location) }
1998
2018
  def def_keyword_loc; end
1999
2019
 
@@ -2012,8 +2032,8 @@ class Prism::DefNode < Prism::Node
2012
2032
  sig { returns(T.nilable(Prism::Location)) }
2013
2033
  def end_keyword_loc; end
2014
2034
 
2015
- sig { params(name: Symbol, name_loc: Prism::Location, receiver: T.nilable(Prism::Node), parameters: T.nilable(Prism::ParametersNode), body: T.nilable(Prism::Node), locals: T::Array[Symbol], locals_body_index: Integer, def_keyword_loc: Prism::Location, operator_loc: T.nilable(Prism::Location), lparen_loc: T.nilable(Prism::Location), rparen_loc: T.nilable(Prism::Location), equal_loc: T.nilable(Prism::Location), end_keyword_loc: T.nilable(Prism::Location), location: Prism::Location).void }
2016
- def initialize(name, name_loc, receiver, parameters, body, locals, locals_body_index, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location); end
2035
+ sig { params(name: Symbol, name_loc: Prism::Location, receiver: T.nilable(Prism::Node), parameters: T.nilable(Prism::ParametersNode), body: T.nilable(Prism::Node), locals: T::Array[Symbol], def_keyword_loc: Prism::Location, operator_loc: T.nilable(Prism::Location), lparen_loc: T.nilable(Prism::Location), rparen_loc: T.nilable(Prism::Location), equal_loc: T.nilable(Prism::Location), end_keyword_loc: T.nilable(Prism::Location), location: Prism::Location).void }
2036
+ def initialize(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location); end
2017
2037
 
2018
2038
  sig { params(visitor: Prism::Visitor).void }
2019
2039
  def accept(visitor); end
@@ -2979,14 +2999,16 @@ class Prism::ImaginaryNode < Prism::Node
2979
2999
  def inspect(inspector); end
2980
3000
  end
2981
3001
 
2982
- # Represents a node that is implicitly being added to the tree but doesn't
2983
- # correspond directly to a node in the source.
3002
+ # Represents a node that is implicitly being added to the tree but doesn't correspond directly to a node in the source.
2984
3003
  #
2985
3004
  # { foo: }
2986
3005
  # ^^^^
2987
3006
  #
2988
3007
  # { Foo: }
2989
3008
  # ^^^^
3009
+ #
3010
+ # foo in { bar: }
3011
+ # ^^^^
2990
3012
  class Prism::ImplicitNode < Prism::Node
2991
3013
  sig { returns(Prism::Node) }
2992
3014
  def value; end
@@ -3153,6 +3175,9 @@ class Prism::IndexAndWriteNode < Prism::Node
3153
3175
  sig { returns(T::Boolean) }
3154
3176
  def attribute_write?; end
3155
3177
 
3178
+ sig { returns(T::Boolean) }
3179
+ def ignore_visibility?; end
3180
+
3156
3181
  sig { returns(T.nilable(String)) }
3157
3182
  def call_operator; end
3158
3183
 
@@ -3231,6 +3256,9 @@ class Prism::IndexOperatorWriteNode < Prism::Node
3231
3256
  sig { returns(T::Boolean) }
3232
3257
  def attribute_write?; end
3233
3258
 
3259
+ sig { returns(T::Boolean) }
3260
+ def ignore_visibility?; end
3261
+
3234
3262
  sig { returns(T.nilable(String)) }
3235
3263
  def call_operator; end
3236
3264
 
@@ -3303,6 +3331,9 @@ class Prism::IndexOrWriteNode < Prism::Node
3303
3331
  sig { returns(T::Boolean) }
3304
3332
  def attribute_write?; end
3305
3333
 
3334
+ sig { returns(T::Boolean) }
3335
+ def ignore_visibility?; end
3336
+
3306
3337
  sig { returns(T.nilable(String)) }
3307
3338
  def call_operator; end
3308
3339
 
@@ -3377,6 +3408,9 @@ class Prism::IndexTargetNode < Prism::Node
3377
3408
  sig { returns(T::Boolean) }
3378
3409
  def attribute_write?; end
3379
3410
 
3411
+ sig { returns(T::Boolean) }
3412
+ def ignore_visibility?; end
3413
+
3380
3414
  sig { returns(String) }
3381
3415
  def opening; end
3382
3416
 
@@ -3657,9 +3691,7 @@ class Prism::IntegerNode < Prism::Node
3657
3691
  def inspect(inspector); end
3658
3692
  end
3659
3693
 
3660
- # Represents a regular expression literal that contains interpolation that
3661
- # is being used in the predicate of a conditional to implicitly match
3662
- # against the last line read by an IO object.
3694
+ # Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO object.
3663
3695
  #
3664
3696
  # if /foo #{bar} baz/ then end
3665
3697
  # ^^^^^^^^^^^^^^^^
@@ -3981,7 +4013,7 @@ class Prism::KeywordHashNode < Prism::Node
3981
4013
  def deconstruct_keys(keys); end
3982
4014
 
3983
4015
  sig { returns(T::Boolean) }
3984
- def static_keys?; end
4016
+ def symbol_keys?; end
3985
4017
 
3986
4018
  sig { params(inspector: Prism::NodeInspector).returns(String) }
3987
4019
  def inspect(inspector); end
@@ -3993,6 +4025,9 @@ end
3993
4025
  # ^^^
3994
4026
  # end
3995
4027
  class Prism::KeywordRestParameterNode < Prism::Node
4028
+ sig { returns(Integer) }
4029
+ def flags; end
4030
+
3996
4031
  sig { returns(T.nilable(Symbol)) }
3997
4032
  def name; end
3998
4033
 
@@ -4002,8 +4037,8 @@ class Prism::KeywordRestParameterNode < Prism::Node
4002
4037
  sig { returns(Prism::Location) }
4003
4038
  def operator_loc; end
4004
4039
 
4005
- sig { params(name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).void }
4006
- def initialize(name, name_loc, operator_loc, location); end
4040
+ sig { params(flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).void }
4041
+ def initialize(flags, name, name_loc, operator_loc, location); end
4007
4042
 
4008
4043
  sig { params(visitor: Prism::Visitor).void }
4009
4044
  def accept(visitor); end
@@ -4020,6 +4055,9 @@ class Prism::KeywordRestParameterNode < Prism::Node
4020
4055
  sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) }
4021
4056
  def deconstruct_keys(keys); end
4022
4057
 
4058
+ sig { returns(T::Boolean) }
4059
+ def repeated_parameter?; end
4060
+
4023
4061
  sig { returns(String) }
4024
4062
  def operator; end
4025
4063
 
@@ -4035,9 +4073,6 @@ class Prism::LambdaNode < Prism::Node
4035
4073
  sig { returns(T::Array[Symbol]) }
4036
4074
  def locals; end
4037
4075
 
4038
- sig { returns(Integer) }
4039
- def locals_body_index; end
4040
-
4041
4076
  sig { returns(Prism::Location) }
4042
4077
  def operator_loc; end
4043
4078
 
@@ -4053,8 +4088,8 @@ class Prism::LambdaNode < Prism::Node
4053
4088
  sig { returns(T.nilable(Prism::Node)) }
4054
4089
  def body; end
4055
4090
 
4056
- sig { params(locals: T::Array[Symbol], locals_body_index: Integer, operator_loc: Prism::Location, opening_loc: Prism::Location, closing_loc: Prism::Location, parameters: T.nilable(Prism::Node), body: T.nilable(Prism::Node), location: Prism::Location).void }
4057
- def initialize(locals, locals_body_index, operator_loc, opening_loc, closing_loc, parameters, body, location); end
4091
+ sig { params(locals: T::Array[Symbol], operator_loc: Prism::Location, opening_loc: Prism::Location, closing_loc: Prism::Location, parameters: T.nilable(Prism::Node), body: T.nilable(Prism::Node), location: Prism::Location).void }
4092
+ def initialize(locals, operator_loc, opening_loc, closing_loc, parameters, body, location); end
4058
4093
 
4059
4094
  sig { params(visitor: Prism::Visitor).void }
4060
4095
  def accept(visitor); end
@@ -4219,9 +4254,7 @@ class Prism::LocalVariableOrWriteNode < Prism::Node
4219
4254
  def inspect(inspector); end
4220
4255
  end
4221
4256
 
4222
- # Represents reading a local variable. Note that this requires that a local
4223
- # variable of the same name has already been written to in the same scope,
4224
- # otherwise it is parsed as a method call.
4257
+ # Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call.
4225
4258
  #
4226
4259
  # foo
4227
4260
  # ^^^
@@ -4332,9 +4365,7 @@ class Prism::LocalVariableWriteNode < Prism::Node
4332
4365
  def inspect(inspector); end
4333
4366
  end
4334
4367
 
4335
- # Represents a regular expression literal used in the predicate of a
4336
- # conditional to implicitly match against the last line read by an IO
4337
- # object.
4368
+ # Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object.
4338
4369
  #
4339
4370
  # if /foo/i then end
4340
4371
  # ^^^^^^
@@ -4496,8 +4527,7 @@ class Prism::MatchRequiredNode < Prism::Node
4496
4527
  def inspect(inspector); end
4497
4528
  end
4498
4529
 
4499
- # Represents writing local variables using a regular expression match with
4500
- # named capture groups.
4530
+ # Represents writing local variables using a regular expression match with named capture groups.
4501
4531
  #
4502
4532
  # /(?<foo>bar)/ =~ baz
4503
4533
  # ^^^^^^^^^^^^^^^^^^^^
@@ -4530,8 +4560,7 @@ class Prism::MatchWriteNode < Prism::Node
4530
4560
  def inspect(inspector); end
4531
4561
  end
4532
4562
 
4533
- # Represents a node that is missing from the source and results in a syntax
4534
- # error.
4563
+ # Represents a node that is missing from the source and results in a syntax error.
4535
4564
  class Prism::MissingNode < Prism::Node
4536
4565
  sig { params(location: Prism::Location).void }
4537
4566
  def initialize(location); end
@@ -4814,8 +4843,7 @@ class Prism::NoKeywordsParameterNode < Prism::Node
4814
4843
  def inspect(inspector); end
4815
4844
  end
4816
4845
 
4817
- # Represents an implicit set of parameters through the use of numbered
4818
- # parameters within a block or lambda.
4846
+ # Represents an implicit set of parameters through the use of numbered parameters within a block or lambda.
4819
4847
  #
4820
4848
  # -> { _1 + _2 }
4821
4849
  # ^^^^^^^^^^^^^^
@@ -4881,6 +4909,9 @@ end
4881
4909
  # ^^^^
4882
4910
  # end
4883
4911
  class Prism::OptionalKeywordParameterNode < Prism::Node
4912
+ sig { returns(Integer) }
4913
+ def flags; end
4914
+
4884
4915
  sig { returns(Symbol) }
4885
4916
  def name; end
4886
4917
 
@@ -4890,8 +4921,8 @@ class Prism::OptionalKeywordParameterNode < Prism::Node
4890
4921
  sig { returns(Prism::Node) }
4891
4922
  def value; end
4892
4923
 
4893
- sig { params(name: Symbol, name_loc: Prism::Location, value: Prism::Node, location: Prism::Location).void }
4894
- def initialize(name, name_loc, value, location); end
4924
+ sig { params(flags: Integer, name: Symbol, name_loc: Prism::Location, value: Prism::Node, location: Prism::Location).void }
4925
+ def initialize(flags, name, name_loc, value, location); end
4895
4926
 
4896
4927
  sig { params(visitor: Prism::Visitor).void }
4897
4928
  def accept(visitor); end
@@ -4908,6 +4939,9 @@ class Prism::OptionalKeywordParameterNode < Prism::Node
4908
4939
  sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) }
4909
4940
  def deconstruct_keys(keys); end
4910
4941
 
4942
+ sig { returns(T::Boolean) }
4943
+ def repeated_parameter?; end
4944
+
4911
4945
  sig { params(inspector: Prism::NodeInspector).returns(String) }
4912
4946
  def inspect(inspector); end
4913
4947
  end
@@ -4918,6 +4952,9 @@ end
4918
4952
  # ^^^^^
4919
4953
  # end
4920
4954
  class Prism::OptionalParameterNode < Prism::Node
4955
+ sig { returns(Integer) }
4956
+ def flags; end
4957
+
4921
4958
  sig { returns(Symbol) }
4922
4959
  def name; end
4923
4960
 
@@ -4930,8 +4967,8 @@ class Prism::OptionalParameterNode < Prism::Node
4930
4967
  sig { returns(Prism::Node) }
4931
4968
  def value; end
4932
4969
 
4933
- sig { params(name: Symbol, name_loc: Prism::Location, operator_loc: Prism::Location, value: Prism::Node, location: Prism::Location).void }
4934
- def initialize(name, name_loc, operator_loc, value, location); end
4970
+ sig { params(flags: Integer, name: Symbol, name_loc: Prism::Location, operator_loc: Prism::Location, value: Prism::Node, location: Prism::Location).void }
4971
+ def initialize(flags, name, name_loc, operator_loc, value, location); end
4935
4972
 
4936
4973
  sig { params(visitor: Prism::Visitor).void }
4937
4974
  def accept(visitor); end
@@ -4948,6 +4985,9 @@ class Prism::OptionalParameterNode < Prism::Node
4948
4985
  sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) }
4949
4986
  def deconstruct_keys(keys); end
4950
4987
 
4988
+ sig { returns(T::Boolean) }
4989
+ def repeated_parameter?; end
4990
+
4951
4991
  sig { returns(String) }
4952
4992
  def operator; end
4953
4993
 
@@ -5087,8 +5127,7 @@ class Prism::ParenthesesNode < Prism::Node
5087
5127
  def inspect(inspector); end
5088
5128
  end
5089
5129
 
5090
- # Represents the use of the `^` operator for pinning an expression in a
5091
- # pattern matching expression.
5130
+ # Represents the use of the `^` operator for pinning an expression in a pattern matching expression.
5092
5131
  #
5093
5132
  # foo in ^(bar)
5094
5133
  # ^^^^^^
@@ -5136,8 +5175,7 @@ class Prism::PinnedExpressionNode < Prism::Node
5136
5175
  def inspect(inspector); end
5137
5176
  end
5138
5177
 
5139
- # Represents the use of the `^` operator for pinning a variable in a pattern
5140
- # matching expression.
5178
+ # Represents the use of the `^` operator for pinning a variable in a pattern matching expression.
5141
5179
  #
5142
5180
  # foo in ^bar
5143
5181
  # ^^^^
@@ -5494,14 +5532,17 @@ end
5494
5532
  # ^^
5495
5533
  # end
5496
5534
  class Prism::RequiredKeywordParameterNode < Prism::Node
5535
+ sig { returns(Integer) }
5536
+ def flags; end
5537
+
5497
5538
  sig { returns(Symbol) }
5498
5539
  def name; end
5499
5540
 
5500
5541
  sig { returns(Prism::Location) }
5501
5542
  def name_loc; end
5502
5543
 
5503
- sig { params(name: Symbol, name_loc: Prism::Location, location: Prism::Location).void }
5504
- def initialize(name, name_loc, location); end
5544
+ sig { params(flags: Integer, name: Symbol, name_loc: Prism::Location, location: Prism::Location).void }
5545
+ def initialize(flags, name, name_loc, location); end
5505
5546
 
5506
5547
  sig { params(visitor: Prism::Visitor).void }
5507
5548
  def accept(visitor); end
@@ -5518,6 +5559,9 @@ class Prism::RequiredKeywordParameterNode < Prism::Node
5518
5559
  sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) }
5519
5560
  def deconstruct_keys(keys); end
5520
5561
 
5562
+ sig { returns(T::Boolean) }
5563
+ def repeated_parameter?; end
5564
+
5521
5565
  sig { params(inspector: Prism::NodeInspector).returns(String) }
5522
5566
  def inspect(inspector); end
5523
5567
  end
@@ -5528,11 +5572,14 @@ end
5528
5572
  # ^
5529
5573
  # end
5530
5574
  class Prism::RequiredParameterNode < Prism::Node
5575
+ sig { returns(Integer) }
5576
+ def flags; end
5577
+
5531
5578
  sig { returns(Symbol) }
5532
5579
  def name; end
5533
5580
 
5534
- sig { params(name: Symbol, location: Prism::Location).void }
5535
- def initialize(name, location); end
5581
+ sig { params(flags: Integer, name: Symbol, location: Prism::Location).void }
5582
+ def initialize(flags, name, location); end
5536
5583
 
5537
5584
  sig { params(visitor: Prism::Visitor).void }
5538
5585
  def accept(visitor); end
@@ -5549,6 +5596,9 @@ class Prism::RequiredParameterNode < Prism::Node
5549
5596
  sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) }
5550
5597
  def deconstruct_keys(keys); end
5551
5598
 
5599
+ sig { returns(T::Boolean) }
5600
+ def repeated_parameter?; end
5601
+
5552
5602
  sig { params(inspector: Prism::NodeInspector).returns(String) }
5553
5603
  def inspect(inspector); end
5554
5604
  end
@@ -5602,8 +5652,7 @@ end
5602
5652
  # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5603
5653
  # end
5604
5654
  #
5605
- # `Foo, *splat, Bar` are in the `exceptions` field.
5606
- # `ex` is in the `exception` field.
5655
+ # `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `exception` field.
5607
5656
  class Prism::RescueNode < Prism::Node
5608
5657
  sig { returns(Prism::Location) }
5609
5658
  def keyword_loc; end
@@ -5657,6 +5706,9 @@ end
5657
5706
  # ^^
5658
5707
  # end
5659
5708
  class Prism::RestParameterNode < Prism::Node
5709
+ sig { returns(Integer) }
5710
+ def flags; end
5711
+
5660
5712
  sig { returns(T.nilable(Symbol)) }
5661
5713
  def name; end
5662
5714
 
@@ -5666,8 +5718,8 @@ class Prism::RestParameterNode < Prism::Node
5666
5718
  sig { returns(Prism::Location) }
5667
5719
  def operator_loc; end
5668
5720
 
5669
- sig { params(name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).void }
5670
- def initialize(name, name_loc, operator_loc, location); end
5721
+ sig { params(flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).void }
5722
+ def initialize(flags, name, name_loc, operator_loc, location); end
5671
5723
 
5672
5724
  sig { params(visitor: Prism::Visitor).void }
5673
5725
  def accept(visitor); end
@@ -5684,6 +5736,9 @@ class Prism::RestParameterNode < Prism::Node
5684
5736
  sig { params(keys: T::Array[Symbol]).returns(T::Hash[Symbol, T.nilable(T.any(Prism::Node, T::Array[Prism::Node], String, Prism::Token, T::Array[Prism::Token], Prism::Location))]) }
5685
5737
  def deconstruct_keys(keys); end
5686
5738
 
5739
+ sig { returns(T::Boolean) }
5740
+ def repeated_parameter?; end
5741
+
5687
5742
  sig { returns(String) }
5688
5743
  def operator; end
5689
5744
 
@@ -5985,8 +6040,7 @@ class Prism::StatementsNode < Prism::Node
5985
6040
  def inspect(inspector); end
5986
6041
  end
5987
6042
 
5988
- # Represents a string literal, a string contained within a `%w` list, or
5989
- # plain string content within an interpolated string.
6043
+ # Represents a string literal, a string contained within a `%w` list, or plain string content within an interpolated string.
5990
6044
  #
5991
6045
  # "foo"
5992
6046
  # ^^^^^
@@ -6570,6 +6624,8 @@ module Prism::CallNodeFlags
6570
6624
  VARIABLE_CALL = T.let(1 << 1, Integer)
6571
6625
  # a call that is an attribute write, so the value being written should be returned
6572
6626
  ATTRIBUTE_WRITE = T.let(1 << 2, Integer)
6627
+ # a call that ignores method visibility
6628
+ IGNORE_VISIBILITY = T.let(1 << 3, Integer)
6573
6629
  end
6574
6630
 
6575
6631
  # Flags for nodes that have unescaped content.
@@ -6594,8 +6650,8 @@ end
6594
6650
 
6595
6651
  # Flags for keyword hash nodes.
6596
6652
  module Prism::KeywordHashNodeFlags
6597
- # a keyword hash which only has `AssocNode` elements all with static literal keys, which means the elements can be treated as keyword arguments
6598
- STATIC_KEYS = T.let(1 << 0, Integer)
6653
+ # a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments
6654
+ SYMBOL_KEYS = T.let(1 << 0, Integer)
6599
6655
  end
6600
6656
 
6601
6657
  # Flags for while and until loop nodes.
@@ -6604,6 +6660,12 @@ module Prism::LoopFlags
6604
6660
  BEGIN_MODIFIER = T.let(1 << 0, Integer)
6605
6661
  end
6606
6662
 
6663
+ # Flags for parameter nodes.
6664
+ module Prism::ParameterFlags
6665
+ # a parameter name that has been repeated in the method signature
6666
+ REPEATED_PARAMETER = T.let(1 << 0, Integer)
6667
+ end
6668
+
6607
6669
  # Flags for range and flip-flop nodes.
6608
6670
  module Prism::RangeFlags
6609
6671
  # ... operator
@@ -7280,7 +7342,7 @@ module Prism::DSL
7280
7342
  sig { params(constant: T.nilable(Prism::Node), requireds: T::Array[Prism::Node], rest: T.nilable(Prism::Node), posts: T::Array[Prism::Node], opening_loc: T.nilable(Prism::Location), closing_loc: T.nilable(Prism::Location), location: Prism::Location).returns(Prism::ArrayPatternNode) }
7281
7343
  def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, location); end
7282
7344
  # Create a new AssocNode node
7283
- sig { params(key: Prism::Node, value: T.nilable(Prism::Node), operator_loc: T.nilable(Prism::Location), location: Prism::Location).returns(Prism::AssocNode) }
7345
+ sig { params(key: Prism::Node, value: Prism::Node, operator_loc: T.nilable(Prism::Location), location: Prism::Location).returns(Prism::AssocNode) }
7284
7346
  def AssocNode(key, value, operator_loc, location); end
7285
7347
  # Create a new AssocSplatNode node
7286
7348
  sig { params(value: T.nilable(Prism::Node), operator_loc: Prism::Location, location: Prism::Location).returns(Prism::AssocSplatNode) }
@@ -7295,14 +7357,14 @@ module Prism::DSL
7295
7357
  sig { params(expression: T.nilable(Prism::Node), operator_loc: Prism::Location, location: Prism::Location).returns(Prism::BlockArgumentNode) }
7296
7358
  def BlockArgumentNode(expression, operator_loc, location); end
7297
7359
  # Create a new BlockLocalVariableNode node
7298
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::BlockLocalVariableNode) }
7299
- def BlockLocalVariableNode(name, location); end
7360
+ sig { params(flags: Integer, name: Symbol, location: Prism::Location).returns(Prism::BlockLocalVariableNode) }
7361
+ def BlockLocalVariableNode(flags, name, location); end
7300
7362
  # Create a new BlockNode node
7301
- sig { params(locals: T::Array[Symbol], locals_body_index: Integer, parameters: T.nilable(Prism::Node), body: T.nilable(Prism::Node), opening_loc: Prism::Location, closing_loc: Prism::Location, location: Prism::Location).returns(Prism::BlockNode) }
7302
- def BlockNode(locals, locals_body_index, parameters, body, opening_loc, closing_loc, location); end
7363
+ sig { params(locals: T::Array[Symbol], parameters: T.nilable(Prism::Node), body: T.nilable(Prism::Node), opening_loc: Prism::Location, closing_loc: Prism::Location, location: Prism::Location).returns(Prism::BlockNode) }
7364
+ def BlockNode(locals, parameters, body, opening_loc, closing_loc, location); end
7303
7365
  # Create a new BlockParameterNode node
7304
- sig { params(name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).returns(Prism::BlockParameterNode) }
7305
- def BlockParameterNode(name, name_loc, operator_loc, location); end
7366
+ sig { params(flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).returns(Prism::BlockParameterNode) }
7367
+ def BlockParameterNode(flags, name, name_loc, operator_loc, location); end
7306
7368
  # Create a new BlockParametersNode node
7307
7369
  sig { params(parameters: T.nilable(Prism::ParametersNode), locals: T::Array[Prism::Node], opening_loc: T.nilable(Prism::Location), closing_loc: T.nilable(Prism::Location), location: Prism::Location).returns(Prism::BlockParametersNode) }
7308
7370
  def BlockParametersNode(parameters, locals, opening_loc, closing_loc, location); end
@@ -7391,8 +7453,8 @@ module Prism::DSL
7391
7453
  sig { params(name: Symbol, name_loc: Prism::Location, value: Prism::Node, operator_loc: Prism::Location, location: Prism::Location).returns(Prism::ConstantWriteNode) }
7392
7454
  def ConstantWriteNode(name, name_loc, value, operator_loc, location); end
7393
7455
  # Create a new DefNode node
7394
- sig { params(name: Symbol, name_loc: Prism::Location, receiver: T.nilable(Prism::Node), parameters: T.nilable(Prism::ParametersNode), body: T.nilable(Prism::Node), locals: T::Array[Symbol], locals_body_index: Integer, def_keyword_loc: Prism::Location, operator_loc: T.nilable(Prism::Location), lparen_loc: T.nilable(Prism::Location), rparen_loc: T.nilable(Prism::Location), equal_loc: T.nilable(Prism::Location), end_keyword_loc: T.nilable(Prism::Location), location: Prism::Location).returns(Prism::DefNode) }
7395
- def DefNode(name, name_loc, receiver, parameters, body, locals, locals_body_index, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location); end
7456
+ sig { params(name: Symbol, name_loc: Prism::Location, receiver: T.nilable(Prism::Node), parameters: T.nilable(Prism::ParametersNode), body: T.nilable(Prism::Node), locals: T::Array[Symbol], def_keyword_loc: Prism::Location, operator_loc: T.nilable(Prism::Location), lparen_loc: T.nilable(Prism::Location), rparen_loc: T.nilable(Prism::Location), equal_loc: T.nilable(Prism::Location), end_keyword_loc: T.nilable(Prism::Location), location: Prism::Location).returns(Prism::DefNode) }
7457
+ def DefNode(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location); end
7396
7458
  # Create a new DefinedNode node
7397
7459
  sig { params(lparen_loc: T.nilable(Prism::Location), value: Prism::Node, rparen_loc: T.nilable(Prism::Location), keyword_loc: Prism::Location, location: Prism::Location).returns(Prism::DefinedNode) }
7398
7460
  def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, location); end
@@ -7523,11 +7585,11 @@ module Prism::DSL
7523
7585
  sig { params(flags: Integer, elements: T::Array[Prism::Node], location: Prism::Location).returns(Prism::KeywordHashNode) }
7524
7586
  def KeywordHashNode(flags, elements, location); end
7525
7587
  # Create a new KeywordRestParameterNode node
7526
- sig { params(name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).returns(Prism::KeywordRestParameterNode) }
7527
- def KeywordRestParameterNode(name, name_loc, operator_loc, location); end
7588
+ sig { params(flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).returns(Prism::KeywordRestParameterNode) }
7589
+ def KeywordRestParameterNode(flags, name, name_loc, operator_loc, location); end
7528
7590
  # Create a new LambdaNode node
7529
- sig { params(locals: T::Array[Symbol], locals_body_index: Integer, operator_loc: Prism::Location, opening_loc: Prism::Location, closing_loc: Prism::Location, parameters: T.nilable(Prism::Node), body: T.nilable(Prism::Node), location: Prism::Location).returns(Prism::LambdaNode) }
7530
- def LambdaNode(locals, locals_body_index, operator_loc, opening_loc, closing_loc, parameters, body, location); end
7591
+ sig { params(locals: T::Array[Symbol], operator_loc: Prism::Location, opening_loc: Prism::Location, closing_loc: Prism::Location, parameters: T.nilable(Prism::Node), body: T.nilable(Prism::Node), location: Prism::Location).returns(Prism::LambdaNode) }
7592
+ def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, location); end
7531
7593
  # Create a new LocalVariableAndWriteNode node
7532
7594
  sig { params(name_loc: Prism::Location, operator_loc: Prism::Location, value: Prism::Node, name: Symbol, depth: Integer, location: Prism::Location).returns(Prism::LocalVariableAndWriteNode) }
7533
7595
  def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, location); end
@@ -7586,11 +7648,11 @@ module Prism::DSL
7586
7648
  sig { params(number: Integer, location: Prism::Location).returns(Prism::NumberedReferenceReadNode) }
7587
7649
  def NumberedReferenceReadNode(number, location); end
7588
7650
  # Create a new OptionalKeywordParameterNode node
7589
- sig { params(name: Symbol, name_loc: Prism::Location, value: Prism::Node, location: Prism::Location).returns(Prism::OptionalKeywordParameterNode) }
7590
- def OptionalKeywordParameterNode(name, name_loc, value, location); end
7651
+ sig { params(flags: Integer, name: Symbol, name_loc: Prism::Location, value: Prism::Node, location: Prism::Location).returns(Prism::OptionalKeywordParameterNode) }
7652
+ def OptionalKeywordParameterNode(flags, name, name_loc, value, location); end
7591
7653
  # Create a new OptionalParameterNode node
7592
- sig { params(name: Symbol, name_loc: Prism::Location, operator_loc: Prism::Location, value: Prism::Node, location: Prism::Location).returns(Prism::OptionalParameterNode) }
7593
- def OptionalParameterNode(name, name_loc, operator_loc, value, location); end
7654
+ sig { params(flags: Integer, name: Symbol, name_loc: Prism::Location, operator_loc: Prism::Location, value: Prism::Node, location: Prism::Location).returns(Prism::OptionalParameterNode) }
7655
+ def OptionalParameterNode(flags, name, name_loc, operator_loc, value, location); end
7594
7656
  # Create a new OrNode node
7595
7657
  sig { params(left: Prism::Node, right: Prism::Node, operator_loc: Prism::Location, location: Prism::Location).returns(Prism::OrNode) }
7596
7658
  def OrNode(left, right, operator_loc, location); end
@@ -7628,11 +7690,11 @@ module Prism::DSL
7628
7690
  sig { params(flags: Integer, opening_loc: Prism::Location, content_loc: Prism::Location, closing_loc: Prism::Location, unescaped: String, location: Prism::Location).returns(Prism::RegularExpressionNode) }
7629
7691
  def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, location); end
7630
7692
  # Create a new RequiredKeywordParameterNode node
7631
- sig { params(name: Symbol, name_loc: Prism::Location, location: Prism::Location).returns(Prism::RequiredKeywordParameterNode) }
7632
- def RequiredKeywordParameterNode(name, name_loc, location); end
7693
+ sig { params(flags: Integer, name: Symbol, name_loc: Prism::Location, location: Prism::Location).returns(Prism::RequiredKeywordParameterNode) }
7694
+ def RequiredKeywordParameterNode(flags, name, name_loc, location); end
7633
7695
  # Create a new RequiredParameterNode node
7634
- sig { params(name: Symbol, location: Prism::Location).returns(Prism::RequiredParameterNode) }
7635
- def RequiredParameterNode(name, location); end
7696
+ sig { params(flags: Integer, name: Symbol, location: Prism::Location).returns(Prism::RequiredParameterNode) }
7697
+ def RequiredParameterNode(flags, name, location); end
7636
7698
  # Create a new RescueModifierNode node
7637
7699
  sig { params(expression: Prism::Node, keyword_loc: Prism::Location, rescue_expression: Prism::Node, location: Prism::Location).returns(Prism::RescueModifierNode) }
7638
7700
  def RescueModifierNode(expression, keyword_loc, rescue_expression, location); end
@@ -7640,8 +7702,8 @@ module Prism::DSL
7640
7702
  sig { params(keyword_loc: Prism::Location, exceptions: T::Array[Prism::Node], operator_loc: T.nilable(Prism::Location), reference: T.nilable(Prism::Node), statements: T.nilable(Prism::StatementsNode), consequent: T.nilable(Prism::RescueNode), location: Prism::Location).returns(Prism::RescueNode) }
7641
7703
  def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, location); end
7642
7704
  # Create a new RestParameterNode node
7643
- sig { params(name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).returns(Prism::RestParameterNode) }
7644
- def RestParameterNode(name, name_loc, operator_loc, location); end
7705
+ sig { params(flags: Integer, name: T.nilable(Symbol), name_loc: T.nilable(Prism::Location), operator_loc: Prism::Location, location: Prism::Location).returns(Prism::RestParameterNode) }
7706
+ def RestParameterNode(flags, name, name_loc, operator_loc, location); end
7645
7707
  # Create a new RetryNode node
7646
7708
  sig { params(location: Prism::Location).returns(Prism::RetryNode) }
7647
7709
  def RetryNode(location); end