prism 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/rbi/prism/node.rbi CHANGED
@@ -152,6 +152,9 @@ end
152
152
  # ^^^^^^^^^^^^^
153
153
  class Prism::ArgumentsNode < Prism::Node
154
154
 
155
+ sig { returns(T::Boolean) }
156
+ def contains_forwarding?; end
157
+
155
158
  sig { returns(T::Boolean) }
156
159
  def contains_keywords?; end
157
160
 
@@ -161,6 +164,9 @@ class Prism::ArgumentsNode < Prism::Node
161
164
  sig { returns(T::Boolean) }
162
165
  def contains_splat?; end
163
166
 
167
+ sig { returns(T::Boolean) }
168
+ def contains_multiple_splats?; end
169
+
164
170
  sig { returns(T::Array[Prism::Node]) }
165
171
  def arguments; end
166
172
 
@@ -656,10 +662,10 @@ class Prism::CallNode < Prism::Node
656
662
  sig { returns(T.nilable(Prism::Location)) }
657
663
  def closing_loc; end
658
664
 
659
- sig { returns(T.nilable(Prism::Node)) }
665
+ sig { returns(T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))) }
660
666
  def block; end
661
667
 
662
- sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), name: Symbol, message_loc: T.nilable(Prism::Location), opening_loc: T.nilable(Prism::Location), arguments: T.nilable(Prism::ArgumentsNode), closing_loc: T.nilable(Prism::Location), block: T.nilable(Prism::Node)).void }
668
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), name: Symbol, message_loc: T.nilable(Prism::Location), opening_loc: T.nilable(Prism::Location), arguments: T.nilable(Prism::ArgumentsNode), closing_loc: T.nilable(Prism::Location), block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))).void }
663
669
  def initialize(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block); end
664
670
 
665
671
  sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
@@ -677,7 +683,7 @@ class Prism::CallNode < Prism::Node
677
683
  sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
678
684
  def comment_targets; end
679
685
 
680
- sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), name: Symbol, message_loc: T.nilable(Prism::Location), opening_loc: T.nilable(Prism::Location), arguments: T.nilable(Prism::ArgumentsNode), closing_loc: T.nilable(Prism::Location), block: T.nilable(Prism::Node)).returns(Prism::CallNode) }
686
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), name: Symbol, message_loc: T.nilable(Prism::Location), opening_loc: T.nilable(Prism::Location), arguments: T.nilable(Prism::ArgumentsNode), closing_loc: T.nilable(Prism::Location), block: T.nilable(T.any(Prism::BlockNode, Prism::BlockArgumentNode))).returns(Prism::CallNode) }
681
687
  def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, name: self.name, message_loc: self.message_loc, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block); end
682
688
 
683
689
  sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
@@ -1851,7 +1857,7 @@ class Prism::IndexAndWriteNode < Prism::Node
1851
1857
  sig { returns(Prism::Location) }
1852
1858
  def closing_loc; end
1853
1859
 
1854
- sig { returns(T.nilable(Prism::Node)) }
1860
+ sig { returns(T.nilable(Prism::BlockArgumentNode)) }
1855
1861
  def block; end
1856
1862
 
1857
1863
  sig { returns(Prism::Location) }
@@ -1860,7 +1866,7 @@ class Prism::IndexAndWriteNode < Prism::Node
1860
1866
  sig { returns(Prism::Node) }
1861
1867
  def value; end
1862
1868
 
1863
- sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::Node), operator_loc: Prism::Location, value: Prism::Node).void }
1869
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::BlockArgumentNode), operator_loc: Prism::Location, value: Prism::Node).void }
1864
1870
  def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); end
1865
1871
 
1866
1872
  sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
@@ -1878,7 +1884,7 @@ class Prism::IndexAndWriteNode < Prism::Node
1878
1884
  sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
1879
1885
  def comment_targets; end
1880
1886
 
1881
- sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::Node), operator_loc: Prism::Location, value: Prism::Node).returns(Prism::IndexAndWriteNode) }
1887
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::BlockArgumentNode), operator_loc: Prism::Location, value: Prism::Node).returns(Prism::IndexAndWriteNode) }
1882
1888
  def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block, operator_loc: self.operator_loc, value: self.value); end
1883
1889
 
1884
1890
  sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
@@ -1939,7 +1945,7 @@ class Prism::IndexOperatorWriteNode < Prism::Node
1939
1945
  sig { returns(Prism::Location) }
1940
1946
  def closing_loc; end
1941
1947
 
1942
- sig { returns(T.nilable(Prism::Node)) }
1948
+ sig { returns(T.nilable(Prism::BlockArgumentNode)) }
1943
1949
  def block; end
1944
1950
 
1945
1951
  sig { returns(Symbol) }
@@ -1951,7 +1957,7 @@ class Prism::IndexOperatorWriteNode < Prism::Node
1951
1957
  sig { returns(Prism::Node) }
1952
1958
  def value; end
1953
1959
 
1954
- sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::Node), binary_operator: Symbol, binary_operator_loc: Prism::Location, value: Prism::Node).void }
1960
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::BlockArgumentNode), binary_operator: Symbol, binary_operator_loc: Prism::Location, value: Prism::Node).void }
1955
1961
  def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value); end
1956
1962
 
1957
1963
  sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
@@ -1969,7 +1975,7 @@ class Prism::IndexOperatorWriteNode < Prism::Node
1969
1975
  sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
1970
1976
  def comment_targets; end
1971
1977
 
1972
- sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::Node), binary_operator: Symbol, binary_operator_loc: Prism::Location, value: Prism::Node).returns(Prism::IndexOperatorWriteNode) }
1978
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::BlockArgumentNode), binary_operator: Symbol, binary_operator_loc: Prism::Location, value: Prism::Node).returns(Prism::IndexOperatorWriteNode) }
1973
1979
  def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block, binary_operator: self.binary_operator, binary_operator_loc: self.binary_operator_loc, value: self.value); end
1974
1980
 
1975
1981
  sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
@@ -2027,7 +2033,7 @@ class Prism::IndexOrWriteNode < Prism::Node
2027
2033
  sig { returns(Prism::Location) }
2028
2034
  def closing_loc; end
2029
2035
 
2030
- sig { returns(T.nilable(Prism::Node)) }
2036
+ sig { returns(T.nilable(Prism::BlockArgumentNode)) }
2031
2037
  def block; end
2032
2038
 
2033
2039
  sig { returns(Prism::Location) }
@@ -2036,7 +2042,7 @@ class Prism::IndexOrWriteNode < Prism::Node
2036
2042
  sig { returns(Prism::Node) }
2037
2043
  def value; end
2038
2044
 
2039
- sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::Node), operator_loc: Prism::Location, value: Prism::Node).void }
2045
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::BlockArgumentNode), operator_loc: Prism::Location, value: Prism::Node).void }
2040
2046
  def initialize(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value); end
2041
2047
 
2042
2048
  sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
@@ -2054,7 +2060,7 @@ class Prism::IndexOrWriteNode < Prism::Node
2054
2060
  sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
2055
2061
  def comment_targets; end
2056
2062
 
2057
- sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::Node), operator_loc: Prism::Location, value: Prism::Node).returns(Prism::IndexOrWriteNode) }
2063
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::BlockArgumentNode), operator_loc: Prism::Location, value: Prism::Node).returns(Prism::IndexOrWriteNode) }
2058
2064
  def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block, operator_loc: self.operator_loc, value: self.value); end
2059
2065
 
2060
2066
  sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
@@ -2120,10 +2126,10 @@ class Prism::IndexTargetNode < Prism::Node
2120
2126
  sig { returns(Prism::Location) }
2121
2127
  def closing_loc; end
2122
2128
 
2123
- sig { returns(T.nilable(Prism::Node)) }
2129
+ sig { returns(T.nilable(Prism::BlockArgumentNode)) }
2124
2130
  def block; end
2125
2131
 
2126
- sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: Prism::Node, opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::Node)).void }
2132
+ sig { params(source: Prism::Source, node_id: Integer, location: Prism::Location, flags: Integer, receiver: Prism::Node, opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::BlockArgumentNode)).void }
2127
2133
  def initialize(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block); end
2128
2134
 
2129
2135
  sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
@@ -2141,7 +2147,7 @@ class Prism::IndexTargetNode < Prism::Node
2141
2147
  sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
2142
2148
  def comment_targets; end
2143
2149
 
2144
- sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: Prism::Node, opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::Node)).returns(Prism::IndexTargetNode) }
2150
+ sig { params(node_id: Integer, location: Prism::Location, flags: Integer, receiver: Prism::Node, opening_loc: Prism::Location, arguments: T.nilable(Prism::ArgumentsNode), closing_loc: Prism::Location, block: T.nilable(Prism::BlockArgumentNode)).returns(Prism::IndexTargetNode) }
2145
2151
  def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block); end
2146
2152
 
2147
2153
  sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
@@ -4461,140 +4467,144 @@ end
4461
4467
 
4462
4468
  # Flags for arguments nodes.
4463
4469
  module Prism::ArgumentsNodeFlags
4464
- # if arguments contain keywords
4465
- CONTAINS_KEYWORDS = T.let(1 << 0, Integer)
4466
- # if arguments contain keyword splat
4467
- CONTAINS_KEYWORD_SPLAT = T.let(1 << 1, Integer)
4468
- # if arguments contain splat
4469
- CONTAINS_SPLAT = T.let(1 << 2, Integer)
4470
+ # if the arguments contain forwarding
4471
+ CONTAINS_FORWARDING = T.let(1 << 2, Integer)
4472
+ # if the arguments contain keywords
4473
+ CONTAINS_KEYWORDS = T.let(1 << 3, Integer)
4474
+ # if the arguments contain a keyword splat
4475
+ CONTAINS_KEYWORD_SPLAT = T.let(1 << 4, Integer)
4476
+ # if the arguments contain a splat
4477
+ CONTAINS_SPLAT = T.let(1 << 5, Integer)
4478
+ # if the arguments contain multiple splats
4479
+ CONTAINS_MULTIPLE_SPLATS = T.let(1 << 6, Integer)
4470
4480
  end
4471
4481
 
4472
4482
  # Flags for array nodes.
4473
4483
  module Prism::ArrayNodeFlags
4474
4484
  # if array contains splat nodes
4475
- CONTAINS_SPLAT = T.let(1 << 0, Integer)
4485
+ CONTAINS_SPLAT = T.let(1 << 2, Integer)
4476
4486
  end
4477
4487
 
4478
4488
  # Flags for call nodes.
4479
4489
  module Prism::CallNodeFlags
4480
4490
  # &. operator
4481
- SAFE_NAVIGATION = T.let(1 << 0, Integer)
4491
+ SAFE_NAVIGATION = T.let(1 << 2, Integer)
4482
4492
  # a call that could have been a local variable
4483
- VARIABLE_CALL = T.let(1 << 1, Integer)
4493
+ VARIABLE_CALL = T.let(1 << 3, Integer)
4484
4494
  # a call that is an attribute write, so the value being written should be returned
4485
- ATTRIBUTE_WRITE = T.let(1 << 2, Integer)
4495
+ ATTRIBUTE_WRITE = T.let(1 << 4, Integer)
4486
4496
  # a call that ignores method visibility
4487
- IGNORE_VISIBILITY = T.let(1 << 3, Integer)
4497
+ IGNORE_VISIBILITY = T.let(1 << 5, Integer)
4488
4498
  end
4489
4499
 
4490
4500
  # Flags for nodes that have unescaped content.
4491
4501
  module Prism::EncodingFlags
4492
4502
  # internal bytes forced the encoding to UTF-8
4493
- FORCED_UTF8_ENCODING = T.let(1 << 0, Integer)
4503
+ FORCED_UTF8_ENCODING = T.let(1 << 2, Integer)
4494
4504
  # internal bytes forced the encoding to binary
4495
- FORCED_BINARY_ENCODING = T.let(1 << 1, Integer)
4505
+ FORCED_BINARY_ENCODING = T.let(1 << 3, Integer)
4496
4506
  end
4497
4507
 
4498
4508
  # Flags for integer nodes that correspond to the base of the integer.
4499
4509
  module Prism::IntegerBaseFlags
4500
4510
  # 0b prefix
4501
- BINARY = T.let(1 << 0, Integer)
4511
+ BINARY = T.let(1 << 2, Integer)
4502
4512
  # 0d or no prefix
4503
- DECIMAL = T.let(1 << 1, Integer)
4513
+ DECIMAL = T.let(1 << 3, Integer)
4504
4514
  # 0o or 0 prefix
4505
- OCTAL = T.let(1 << 2, Integer)
4515
+ OCTAL = T.let(1 << 4, Integer)
4506
4516
  # 0x prefix
4507
- HEXADECIMAL = T.let(1 << 3, Integer)
4517
+ HEXADECIMAL = T.let(1 << 5, Integer)
4508
4518
  end
4509
4519
 
4510
4520
  # Flags for interpolated string nodes that indicated mutability if they are also marked as literals.
4511
4521
  module Prism::InterpolatedStringNodeFlags
4512
4522
  # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'`
4513
- FROZEN = T.let(1 << 0, Integer)
4523
+ FROZEN = T.let(1 << 2, Integer)
4514
4524
  # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`; only for adjacent string literals like `'a' 'b'`
4515
- MUTABLE = T.let(1 << 1, Integer)
4525
+ MUTABLE = T.let(1 << 3, Integer)
4516
4526
  end
4517
4527
 
4518
4528
  # Flags for keyword hash nodes.
4519
4529
  module Prism::KeywordHashNodeFlags
4520
4530
  # a keyword hash which only has `AssocNode` elements all with symbol keys, which means the elements can be treated as keyword arguments
4521
- SYMBOL_KEYS = T.let(1 << 0, Integer)
4531
+ SYMBOL_KEYS = T.let(1 << 2, Integer)
4522
4532
  end
4523
4533
 
4524
4534
  # Flags for while and until loop nodes.
4525
4535
  module Prism::LoopFlags
4526
4536
  # a loop after a begin statement, so the body is executed first before the condition
4527
- BEGIN_MODIFIER = T.let(1 << 0, Integer)
4537
+ BEGIN_MODIFIER = T.let(1 << 2, Integer)
4528
4538
  end
4529
4539
 
4530
4540
  # Flags for parameter nodes.
4531
4541
  module Prism::ParameterFlags
4532
4542
  # a parameter name that has been repeated in the method signature
4533
- REPEATED_PARAMETER = T.let(1 << 0, Integer)
4543
+ REPEATED_PARAMETER = T.let(1 << 2, Integer)
4534
4544
  end
4535
4545
 
4536
4546
  # Flags for range and flip-flop nodes.
4537
4547
  module Prism::RangeFlags
4538
4548
  # ... operator
4539
- EXCLUDE_END = T.let(1 << 0, Integer)
4549
+ EXCLUDE_END = T.let(1 << 2, Integer)
4540
4550
  end
4541
4551
 
4542
4552
  # Flags for regular expression and match last line nodes.
4543
4553
  module Prism::RegularExpressionFlags
4544
4554
  # i - ignores the case of characters when matching
4545
- IGNORE_CASE = T.let(1 << 0, Integer)
4555
+ IGNORE_CASE = T.let(1 << 2, Integer)
4546
4556
  # x - ignores whitespace and allows comments in regular expressions
4547
- EXTENDED = T.let(1 << 1, Integer)
4557
+ EXTENDED = T.let(1 << 3, Integer)
4548
4558
  # m - allows $ to match the end of lines within strings
4549
- MULTI_LINE = T.let(1 << 2, Integer)
4559
+ MULTI_LINE = T.let(1 << 4, Integer)
4550
4560
  # o - only interpolates values into the regular expression once
4551
- ONCE = T.let(1 << 3, Integer)
4561
+ ONCE = T.let(1 << 5, Integer)
4552
4562
  # e - forces the EUC-JP encoding
4553
- EUC_JP = T.let(1 << 4, Integer)
4563
+ EUC_JP = T.let(1 << 6, Integer)
4554
4564
  # n - forces the ASCII-8BIT encoding
4555
- ASCII_8BIT = T.let(1 << 5, Integer)
4565
+ ASCII_8BIT = T.let(1 << 7, Integer)
4556
4566
  # s - forces the Windows-31J encoding
4557
- WINDOWS_31J = T.let(1 << 6, Integer)
4567
+ WINDOWS_31J = T.let(1 << 8, Integer)
4558
4568
  # u - forces the UTF-8 encoding
4559
- UTF_8 = T.let(1 << 7, Integer)
4569
+ UTF_8 = T.let(1 << 9, Integer)
4560
4570
  # internal bytes forced the encoding to UTF-8
4561
- FORCED_UTF8_ENCODING = T.let(1 << 8, Integer)
4571
+ FORCED_UTF8_ENCODING = T.let(1 << 10, Integer)
4562
4572
  # internal bytes forced the encoding to binary
4563
- FORCED_BINARY_ENCODING = T.let(1 << 9, Integer)
4573
+ FORCED_BINARY_ENCODING = T.let(1 << 11, Integer)
4564
4574
  # internal bytes forced the encoding to US-ASCII
4565
- FORCED_US_ASCII_ENCODING = T.let(1 << 10, Integer)
4575
+ FORCED_US_ASCII_ENCODING = T.let(1 << 12, Integer)
4566
4576
  end
4567
4577
 
4568
4578
  # Flags for shareable constant nodes.
4569
4579
  module Prism::ShareableConstantNodeFlags
4570
4580
  # constant writes that should be modified with shareable constant value literal
4571
- LITERAL = T.let(1 << 0, Integer)
4581
+ LITERAL = T.let(1 << 2, Integer)
4572
4582
  # constant writes that should be modified with shareable constant value experimental everything
4573
- EXPERIMENTAL_EVERYTHING = T.let(1 << 1, Integer)
4583
+ EXPERIMENTAL_EVERYTHING = T.let(1 << 3, Integer)
4574
4584
  # constant writes that should be modified with shareable constant value experimental copy
4575
- EXPERIMENTAL_COPY = T.let(1 << 2, Integer)
4585
+ EXPERIMENTAL_COPY = T.let(1 << 4, Integer)
4576
4586
  end
4577
4587
 
4578
4588
  # Flags for string nodes.
4579
4589
  module Prism::StringFlags
4580
4590
  # internal bytes forced the encoding to UTF-8
4581
- FORCED_UTF8_ENCODING = T.let(1 << 0, Integer)
4591
+ FORCED_UTF8_ENCODING = T.let(1 << 2, Integer)
4582
4592
  # internal bytes forced the encoding to binary
4583
- FORCED_BINARY_ENCODING = T.let(1 << 1, Integer)
4593
+ FORCED_BINARY_ENCODING = T.let(1 << 3, Integer)
4584
4594
  # frozen by virtue of a `frozen_string_literal: true` comment or `--enable-frozen-string-literal`
4585
- FROZEN = T.let(1 << 2, Integer)
4595
+ FROZEN = T.let(1 << 4, Integer)
4586
4596
  # mutable by virtue of a `frozen_string_literal: false` comment or `--disable-frozen-string-literal`
4587
- MUTABLE = T.let(1 << 3, Integer)
4597
+ MUTABLE = T.let(1 << 5, Integer)
4588
4598
  end
4589
4599
 
4590
4600
  # Flags for symbol nodes.
4591
4601
  module Prism::SymbolFlags
4592
4602
  # internal bytes forced the encoding to UTF-8
4593
- FORCED_UTF8_ENCODING = T.let(1 << 0, Integer)
4603
+ FORCED_UTF8_ENCODING = T.let(1 << 2, Integer)
4594
4604
  # internal bytes forced the encoding to binary
4595
- FORCED_BINARY_ENCODING = T.let(1 << 1, Integer)
4605
+ FORCED_BINARY_ENCODING = T.let(1 << 3, Integer)
4596
4606
  # internal bytes forced the encoding to US-ASCII
4597
- FORCED_US_ASCII_ENCODING = T.let(1 << 2, Integer)
4607
+ FORCED_US_ASCII_ENCODING = T.let(1 << 4, Integer)
4598
4608
  end
4599
4609
 
4600
4610
  # The flags that are common to all nodes.
data/rbi/prism.rbi CHANGED
@@ -1,17 +1,17 @@
1
1
  # typed: strict
2
2
 
3
3
  module Prism
4
- sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(String) }
5
- def self.dump(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
4
+ sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(String) }
5
+ def self.dump(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
6
6
 
7
- sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(String) }
8
- def self.dump_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
7
+ sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(String) }
8
+ def self.dump_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
9
9
 
10
- sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::LexResult) }
11
- def self.lex(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
10
+ sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::LexResult) }
11
+ def self.lex(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
12
12
 
13
- sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::LexResult) }
14
- def self.lex_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
13
+ sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::LexResult) }
14
+ def self.lex_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
15
15
 
16
16
  sig { params(source: String, options: T::Hash[Symbol, T.untyped]).returns(Prism::LexCompat::Result) }
17
17
  def self.lex_compat(source, **options); end
@@ -22,42 +22,42 @@ module Prism
22
22
  sig { params(source: String, serialized: String).returns(Prism::ParseResult) }
23
23
  def self.load(source, serialized); end
24
24
 
25
- sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
26
- def self.parse(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
25
+ sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
26
+ def self.parse(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
27
27
 
28
- sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
29
- def self.parse_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
28
+ sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
29
+ def self.parse_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
30
30
 
31
- sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).void }
32
- def self.profile(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
31
+ sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).void }
32
+ def self.profile(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
33
33
 
34
- sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).void }
35
- def self.profile_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
34
+ sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).void }
35
+ def self.profile_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
36
36
 
37
- sig { params(stream: T.any(IO, StringIO), command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
38
- def self.parse_stream(stream, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
37
+ sig { params(stream: T.any(IO, StringIO), command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
38
+ def self.parse_stream(stream, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
39
39
 
40
- sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(String, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Array[Prism::Comment]) }
41
- def self.parse_comments(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
40
+ sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(String, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Array[Prism::Comment]) }
41
+ def self.parse_comments(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
42
42
 
43
- sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Array[Prism::Comment]) }
44
- def self.parse_file_comments(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
43
+ sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Array[Prism::Comment]) }
44
+ def self.parse_file_comments(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
45
45
 
46
- sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseLexResult) }
47
- def self.parse_lex(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
46
+ sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseLexResult) }
47
+ def self.parse_lex(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
48
48
 
49
- sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseLexResult) }
50
- def self.parse_lex_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
49
+ sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseLexResult) }
50
+ def self.parse_lex_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
51
51
 
52
- sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
53
- def self.parse_success?(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
52
+ sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
53
+ def self.parse_success?(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
54
54
 
55
- sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
56
- def self.parse_failure?(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
55
+ sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
56
+ def self.parse_failure?(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
57
57
 
58
- sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
59
- def self.parse_file_success?(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
58
+ sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
59
+ def self.parse_file_success?(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
60
60
 
61
- sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
62
- def self.parse_file_failure?(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
61
+ sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
62
+ def self.parse_file_failure?(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
63
63
  end