prism 0.28.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +41 -1
  3. data/CONTRIBUTING.md +0 -4
  4. data/README.md +1 -0
  5. data/config.yml +95 -26
  6. data/docs/fuzzing.md +1 -1
  7. data/docs/ripper_translation.md +22 -0
  8. data/ext/prism/api_node.c +70 -52
  9. data/ext/prism/extconf.rb +27 -23
  10. data/ext/prism/extension.c +107 -372
  11. data/ext/prism/extension.h +1 -1
  12. data/include/prism/ast.h +170 -102
  13. data/include/prism/diagnostic.h +18 -3
  14. data/include/prism/node.h +0 -21
  15. data/include/prism/parser.h +23 -25
  16. data/include/prism/regexp.h +17 -8
  17. data/include/prism/static_literals.h +3 -2
  18. data/include/prism/util/pm_char.h +1 -2
  19. data/include/prism/util/pm_constant_pool.h +0 -8
  20. data/include/prism/util/pm_integer.h +16 -9
  21. data/include/prism/util/pm_string.h +0 -8
  22. data/include/prism/version.h +2 -2
  23. data/include/prism.h +0 -11
  24. data/lib/prism/compiler.rb +3 -0
  25. data/lib/prism/desugar_compiler.rb +4 -4
  26. data/lib/prism/dispatcher.rb +14 -0
  27. data/lib/prism/dot_visitor.rb +54 -35
  28. data/lib/prism/dsl.rb +23 -18
  29. data/lib/prism/ffi.rb +25 -4
  30. data/lib/prism/inspect_visitor.rb +26 -24
  31. data/lib/prism/mutation_compiler.rb +6 -1
  32. data/lib/prism/node.rb +314 -389
  33. data/lib/prism/node_ext.rb +175 -17
  34. data/lib/prism/parse_result/comments.rb +1 -8
  35. data/lib/prism/parse_result/newlines.rb +102 -12
  36. data/lib/prism/parse_result.rb +17 -0
  37. data/lib/prism/reflection.rb +11 -9
  38. data/lib/prism/serialize.rb +91 -68
  39. data/lib/prism/translation/parser/compiler.rb +288 -138
  40. data/lib/prism/translation/parser.rb +7 -2
  41. data/lib/prism/translation/ripper.rb +24 -22
  42. data/lib/prism/translation/ruby_parser.rb +32 -14
  43. data/lib/prism/visitor.rb +3 -0
  44. data/lib/prism.rb +0 -4
  45. data/prism.gemspec +2 -4
  46. data/rbi/prism/node.rbi +114 -57
  47. data/rbi/prism/node_ext.rbi +5 -0
  48. data/rbi/prism/parse_result.rbi +1 -1
  49. data/rbi/prism/visitor.rbi +3 -0
  50. data/rbi/prism.rbi +6 -0
  51. data/sig/prism/dsl.rbs +13 -10
  52. data/sig/prism/lex_compat.rbs +10 -0
  53. data/sig/prism/mutation_compiler.rbs +1 -0
  54. data/sig/prism/node.rbs +72 -48
  55. data/sig/prism/node_ext.rbs +4 -0
  56. data/sig/prism/visitor.rbs +1 -0
  57. data/sig/prism.rbs +21 -0
  58. data/src/diagnostic.c +56 -27
  59. data/src/node.c +432 -1690
  60. data/src/prettyprint.c +97 -54
  61. data/src/prism.c +1286 -1196
  62. data/src/regexp.c +133 -68
  63. data/src/serialize.c +22 -17
  64. data/src/static_literals.c +63 -84
  65. data/src/token_type.c +4 -4
  66. data/src/util/pm_constant_pool.c +0 -8
  67. data/src/util/pm_integer.c +39 -11
  68. data/src/util/pm_string.c +0 -12
  69. data/src/util/pm_strpbrk.c +32 -6
  70. metadata +3 -5
  71. data/include/prism/util/pm_string_list.h +0 -44
  72. data/lib/prism/debug.rb +0 -249
  73. data/src/util/pm_string_list.c +0 -28
data/sig/prism/node.rbs CHANGED
@@ -23,6 +23,8 @@ module Prism
23
23
  def pretty_print: (untyped q) -> untyped
24
24
  def to_dot: () -> String
25
25
  def tunnel: (Integer line, Integer column) -> Array[Prism::node]
26
+ def deprecated: (*String) -> void
27
+ def newline!: (Array[untyped]) -> void
26
28
  end
27
29
 
28
30
  type node_singleton = singleton(Node) & _NodeSingleton
@@ -504,13 +506,13 @@ module Prism
504
506
  attr_reader message_loc: Location?
505
507
  attr_reader read_name: Symbol
506
508
  attr_reader write_name: Symbol
507
- attr_reader operator: Symbol
508
- attr_reader operator_loc: Location
509
+ attr_reader binary_operator: Symbol
510
+ attr_reader binary_operator_loc: Location
509
511
  attr_reader value: Prism::node
510
512
 
511
- def initialize: (Source source, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol operator, Location operator_loc, Prism::node value, Location location) -> void
512
- def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOperatorWriteNode
513
- def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator: Symbol, operator_loc: Location, value: Prism::node, location: Location }
513
+ def initialize: (Source source, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void
514
+ def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOperatorWriteNode
515
+ def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node, location: Location }
514
516
  def safe_navigation?: () -> bool
515
517
  def variable_call?: () -> bool
516
518
  def attribute_write?: () -> bool
@@ -715,13 +717,13 @@ module Prism
715
717
 
716
718
  attr_reader name: Symbol
717
719
  attr_reader name_loc: Location
718
- attr_reader operator_loc: Location
720
+ attr_reader binary_operator_loc: Location
719
721
  attr_reader value: Prism::node
720
- attr_reader operator: Symbol
722
+ attr_reader binary_operator: Symbol
721
723
 
722
- def initialize: (Source source, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
723
- def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> ClassVariableOperatorWriteNode
724
- def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
724
+ def initialize: (Source source, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
725
+ def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ClassVariableOperatorWriteNode
726
+ def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
725
727
  def type: () -> :class_variable_operator_write_node
726
728
  | ...
727
729
  def self.type: () -> :class_variable_operator_write_node
@@ -833,13 +835,13 @@ module Prism
833
835
 
834
836
  attr_reader name: Symbol
835
837
  attr_reader name_loc: Location
836
- attr_reader operator_loc: Location
838
+ attr_reader binary_operator_loc: Location
837
839
  attr_reader value: Prism::node
838
- attr_reader operator: Symbol
840
+ attr_reader binary_operator: Symbol
839
841
 
840
- def initialize: (Source source, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
841
- def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> ConstantOperatorWriteNode
842
- def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
842
+ def initialize: (Source source, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
843
+ def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantOperatorWriteNode
844
+ def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
843
845
  def type: () -> :constant_operator_write_node
844
846
  | ...
845
847
  def self.type: () -> :constant_operator_write_node
@@ -915,13 +917,13 @@ module Prism
915
917
  include _Node
916
918
 
917
919
  attr_reader target: ConstantPathNode
918
- attr_reader operator_loc: Location
920
+ attr_reader binary_operator_loc: Location
919
921
  attr_reader value: Prism::node
920
- attr_reader operator: Symbol
922
+ attr_reader binary_operator: Symbol
921
923
 
922
- def initialize: (Source source, ConstantPathNode target, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
923
- def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> ConstantPathOperatorWriteNode
924
- def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
924
+ def initialize: (Source source, ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
925
+ def copy: (?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantPathOperatorWriteNode
926
+ def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
925
927
  def type: () -> :constant_path_operator_write_node
926
928
  | ...
927
929
  def self.type: () -> :constant_path_operator_write_node
@@ -1387,13 +1389,13 @@ module Prism
1387
1389
 
1388
1390
  attr_reader name: Symbol
1389
1391
  attr_reader name_loc: Location
1390
- attr_reader operator_loc: Location
1392
+ attr_reader binary_operator_loc: Location
1391
1393
  attr_reader value: Prism::node
1392
- attr_reader operator: Symbol
1394
+ attr_reader binary_operator: Symbol
1393
1395
 
1394
- def initialize: (Source source, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
1395
- def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> GlobalVariableOperatorWriteNode
1396
- def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
1396
+ def initialize: (Source source, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
1397
+ def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> GlobalVariableOperatorWriteNode
1398
+ def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
1397
1399
  def type: () -> :global_variable_operator_write_node
1398
1400
  | ...
1399
1401
  def self.type: () -> :global_variable_operator_write_node
@@ -1687,13 +1689,13 @@ module Prism
1687
1689
  attr_reader arguments: ArgumentsNode?
1688
1690
  attr_reader closing_loc: Location
1689
1691
  attr_reader block: Prism::node?
1690
- attr_reader operator: Symbol
1691
- attr_reader operator_loc: Location
1692
+ attr_reader binary_operator: Symbol
1693
+ attr_reader binary_operator_loc: Location
1692
1694
  attr_reader value: Prism::node
1693
1695
 
1694
- def initialize: (Source source, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Symbol operator, Location operator_loc, Prism::node value, Location location) -> void
1695
- def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOperatorWriteNode
1696
- def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator: Symbol, operator_loc: Location, value: Prism::node, location: Location }
1696
+ def initialize: (Source source, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Symbol binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void
1697
+ def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOperatorWriteNode
1698
+ def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node, location: Location }
1697
1699
  def safe_navigation?: () -> bool
1698
1700
  def variable_call?: () -> bool
1699
1701
  def attribute_write?: () -> bool
@@ -1805,13 +1807,13 @@ module Prism
1805
1807
 
1806
1808
  attr_reader name: Symbol
1807
1809
  attr_reader name_loc: Location
1808
- attr_reader operator_loc: Location
1810
+ attr_reader binary_operator_loc: Location
1809
1811
  attr_reader value: Prism::node
1810
- attr_reader operator: Symbol
1812
+ attr_reader binary_operator: Symbol
1811
1813
 
1812
- def initialize: (Source source, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
1813
- def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> InstanceVariableOperatorWriteNode
1814
- def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
1814
+ def initialize: (Source source, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
1815
+ def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> InstanceVariableOperatorWriteNode
1816
+ def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
1815
1817
  def type: () -> :instance_variable_operator_write_node
1816
1818
  | ...
1817
1819
  def self.type: () -> :instance_variable_operator_write_node
@@ -2047,6 +2049,22 @@ module Prism
2047
2049
  def self.type: () -> :interpolated_x_string_node
2048
2050
  end
2049
2051
 
2052
+ # Represents reading from the implicit `it` local variable.
2053
+ #
2054
+ # -> { it }
2055
+ # ^^
2056
+ class ItLocalVariableReadNode < Node
2057
+ include _Node
2058
+
2059
+
2060
+ def initialize: (Source source, Location location) -> void
2061
+ def copy: (?location: Location) -> ItLocalVariableReadNode
2062
+ def deconstruct_keys: (Array[Symbol] keys) -> { location: Location }
2063
+ def type: () -> :it_local_variable_read_node
2064
+ | ...
2065
+ def self.type: () -> :it_local_variable_read_node
2066
+ end
2067
+
2050
2068
  # Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda.
2051
2069
  #
2052
2070
  # -> { it + it }
@@ -2160,15 +2178,15 @@ module Prism
2160
2178
  include _Node
2161
2179
 
2162
2180
  attr_reader name_loc: Location
2163
- attr_reader operator_loc: Location
2181
+ attr_reader binary_operator_loc: Location
2164
2182
  attr_reader value: Prism::node
2165
2183
  attr_reader name: Symbol
2166
- attr_reader operator: Symbol
2184
+ attr_reader binary_operator: Symbol
2167
2185
  attr_reader depth: Integer
2168
2186
 
2169
- def initialize: (Source source, Location name_loc, Location operator_loc, Prism::node value, Symbol name, Symbol operator, Integer depth, Location location) -> void
2170
- def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?operator: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOperatorWriteNode
2171
- def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, operator: Symbol, depth: Integer, location: Location }
2187
+ def initialize: (Source source, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth, Location location) -> void
2188
+ def copy: (?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOperatorWriteNode
2189
+ def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, binary_operator_loc: Location, value: Prism::node, name: Symbol, binary_operator: Symbol, depth: Integer, location: Location }
2172
2190
  def type: () -> :local_variable_operator_write_node
2173
2191
  | ...
2174
2192
  def self.type: () -> :local_variable_operator_write_node
@@ -2600,14 +2618,14 @@ module Prism
2600
2618
  attr_reader requireds: Array[RequiredParameterNode | MultiTargetNode]
2601
2619
  attr_reader optionals: Array[OptionalParameterNode]
2602
2620
  attr_reader rest: RestParameterNode | ImplicitRestNode | nil
2603
- attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode]
2621
+ attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode]
2604
2622
  attr_reader keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode]
2605
2623
  attr_reader keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil
2606
2624
  attr_reader block: BlockParameterNode?
2607
2625
 
2608
- def initialize: (Source source, Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, RestParameterNode | ImplicitRestNode | nil rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil keyword_rest, BlockParameterNode? block, Location location) -> void
2609
- def copy: (?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?, ?location: Location) -> ParametersNode
2610
- def deconstruct_keys: (Array[Symbol] keys) -> { requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode?, location: Location }
2626
+ def initialize: (Source source, Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, RestParameterNode | ImplicitRestNode | nil rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil keyword_rest, BlockParameterNode? block, Location location) -> void
2627
+ def copy: (?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?, ?location: Location) -> ParametersNode
2628
+ def deconstruct_keys: (Array[Symbol] keys) -> { requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode?, location: Location }
2611
2629
  def type: () -> :parameters_node
2612
2630
  | ...
2613
2631
  def self.type: () -> :parameters_node
@@ -2769,11 +2787,17 @@ module Prism
2769
2787
  class RationalNode < Node
2770
2788
  include _Node
2771
2789
 
2772
- attr_reader numeric: Prism::node
2790
+ attr_reader flags: Integer
2791
+ attr_reader numerator: Integer
2792
+ attr_reader denominator: Integer
2773
2793
 
2774
- def initialize: (Source source, Prism::node numeric, Location location) -> void
2775
- def copy: (?numeric: Prism::node, ?location: Location) -> RationalNode
2776
- def deconstruct_keys: (Array[Symbol] keys) -> { numeric: Prism::node, location: Location }
2794
+ def initialize: (Source source, Integer flags, Integer numerator, Integer denominator, Location location) -> void
2795
+ def copy: (?flags: Integer, ?numerator: Integer, ?denominator: Integer, ?location: Location) -> RationalNode
2796
+ def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, numerator: Integer, denominator: Integer, location: Location }
2797
+ def binary?: () -> bool
2798
+ def decimal?: () -> bool
2799
+ def octal?: () -> bool
2800
+ def hexadecimal?: () -> bool
2777
2801
  def type: () -> :rational_node
2778
2802
  | ...
2779
2803
  def self.type: () -> :rational_node
@@ -75,4 +75,8 @@ module Prism
75
75
  class ParametersNode < Node
76
76
  def signature: () -> Array[[Symbol, Symbol] | [Symbol]]
77
77
  end
78
+
79
+ class CallNode < Node
80
+ def full_message_loc: () -> Location?
81
+ end
78
82
  end
@@ -97,6 +97,7 @@ module Prism
97
97
  def visit_interpolated_string_node: (InterpolatedStringNode) -> void
98
98
  def visit_interpolated_symbol_node: (InterpolatedSymbolNode) -> void
99
99
  def visit_interpolated_x_string_node: (InterpolatedXStringNode) -> void
100
+ def visit_it_local_variable_read_node: (ItLocalVariableReadNode) -> void
100
101
  def visit_it_parameters_node: (ItParametersNode) -> void
101
102
  def visit_keyword_hash_node: (KeywordHashNode) -> void
102
103
  def visit_keyword_rest_parameter_node: (KeywordRestParameterNode) -> void
data/sig/prism.rbs CHANGED
@@ -19,6 +19,17 @@ module Prism
19
19
  ?scopes: Array[Array[Symbol]]
20
20
  ) -> ParseResult
21
21
 
22
+ def self.profile: (
23
+ String source,
24
+ ?filepath: String,
25
+ ?line: Integer,
26
+ ?offset: Integer,
27
+ ?encoding: Encoding,
28
+ ?frozen_string_literal: bool,
29
+ ?verbose: bool,
30
+ ?scopes: Array[Array[Symbol]]
31
+ ) -> nil
32
+
22
33
  def self.lex: (
23
34
  String source,
24
35
  ?filepath: String,
@@ -117,6 +128,16 @@ module Prism
117
128
  ?scopes: Array[Array[Symbol]]
118
129
  ) -> ParseResult
119
130
 
131
+ def self.profile_file: (
132
+ String filepath,
133
+ ?line: Integer,
134
+ ?offset: Integer,
135
+ ?encoding: Encoding,
136
+ ?frozen_string_literal: bool,
137
+ ?verbose: bool,
138
+ ?scopes: Array[Array[Symbol]]
139
+ ) -> nil
140
+
120
141
  def self.lex_file: (
121
142
  String filepath,
122
143
  ?line: Integer,