prism 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +41 -1
- data/CONTRIBUTING.md +0 -4
- data/README.md +1 -0
- data/config.yml +95 -26
- data/docs/fuzzing.md +1 -1
- data/docs/ripper_translation.md +22 -0
- data/ext/prism/api_node.c +70 -52
- data/ext/prism/extconf.rb +27 -23
- data/ext/prism/extension.c +107 -372
- data/ext/prism/extension.h +1 -1
- data/include/prism/ast.h +170 -102
- data/include/prism/diagnostic.h +18 -3
- data/include/prism/node.h +0 -21
- data/include/prism/parser.h +23 -25
- data/include/prism/regexp.h +17 -8
- data/include/prism/static_literals.h +3 -2
- data/include/prism/util/pm_char.h +1 -2
- data/include/prism/util/pm_constant_pool.h +0 -8
- data/include/prism/util/pm_integer.h +16 -9
- data/include/prism/util/pm_string.h +0 -8
- data/include/prism/version.h +2 -2
- data/include/prism.h +0 -11
- data/lib/prism/compiler.rb +3 -0
- data/lib/prism/desugar_compiler.rb +4 -4
- data/lib/prism/dispatcher.rb +14 -0
- data/lib/prism/dot_visitor.rb +54 -35
- data/lib/prism/dsl.rb +23 -18
- data/lib/prism/ffi.rb +25 -4
- data/lib/prism/inspect_visitor.rb +26 -24
- data/lib/prism/mutation_compiler.rb +6 -1
- data/lib/prism/node.rb +314 -389
- data/lib/prism/node_ext.rb +175 -17
- data/lib/prism/parse_result/comments.rb +1 -8
- data/lib/prism/parse_result/newlines.rb +102 -12
- data/lib/prism/parse_result.rb +17 -0
- data/lib/prism/reflection.rb +11 -9
- data/lib/prism/serialize.rb +91 -68
- data/lib/prism/translation/parser/compiler.rb +288 -138
- data/lib/prism/translation/parser.rb +7 -2
- data/lib/prism/translation/ripper.rb +24 -22
- data/lib/prism/translation/ruby_parser.rb +32 -14
- data/lib/prism/visitor.rb +3 -0
- data/lib/prism.rb +0 -4
- data/prism.gemspec +2 -4
- data/rbi/prism/node.rbi +114 -57
- data/rbi/prism/node_ext.rbi +5 -0
- data/rbi/prism/parse_result.rbi +1 -1
- data/rbi/prism/visitor.rbi +3 -0
- data/rbi/prism.rbi +6 -0
- data/sig/prism/dsl.rbs +13 -10
- data/sig/prism/lex_compat.rbs +10 -0
- data/sig/prism/mutation_compiler.rbs +1 -0
- data/sig/prism/node.rbs +72 -48
- data/sig/prism/node_ext.rbs +4 -0
- data/sig/prism/visitor.rbs +1 -0
- data/sig/prism.rbs +21 -0
- data/src/diagnostic.c +56 -27
- data/src/node.c +432 -1690
- data/src/prettyprint.c +97 -54
- data/src/prism.c +1286 -1196
- data/src/regexp.c +133 -68
- data/src/serialize.c +22 -17
- data/src/static_literals.c +63 -84
- data/src/token_type.c +4 -4
- data/src/util/pm_constant_pool.c +0 -8
- data/src/util/pm_integer.c +39 -11
- data/src/util/pm_string.c +0 -12
- data/src/util/pm_strpbrk.c +32 -6
- metadata +3 -5
- data/include/prism/util/pm_string_list.h +0 -44
- data/lib/prism/debug.rb +0 -249
- data/src/util/pm_string_list.c +0 -28
data/rbi/prism/node.rbi
CHANGED
@@ -1199,16 +1199,16 @@ class Prism::CallOperatorWriteNode < Prism::Node
|
|
1199
1199
|
def write_name; end
|
1200
1200
|
|
1201
1201
|
sig { returns(Symbol) }
|
1202
|
-
def
|
1202
|
+
def binary_operator; end
|
1203
1203
|
|
1204
1204
|
sig { returns(Prism::Location) }
|
1205
|
-
def
|
1205
|
+
def binary_operator_loc; end
|
1206
1206
|
|
1207
1207
|
sig { returns(Prism::Node) }
|
1208
1208
|
def value; end
|
1209
1209
|
|
1210
|
-
sig { params(source: Prism::Source, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), message_loc: T.nilable(Prism::Location), read_name: Symbol, write_name: Symbol,
|
1211
|
-
def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name,
|
1210
|
+
sig { params(source: Prism::Source, flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), message_loc: T.nilable(Prism::Location), read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Prism::Location, value: Prism::Node, location: Prism::Location).void }
|
1211
|
+
def initialize(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, location); end
|
1212
1212
|
|
1213
1213
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
1214
1214
|
def accept(visitor); end
|
@@ -1225,8 +1225,8 @@ class Prism::CallOperatorWriteNode < Prism::Node
|
|
1225
1225
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
1226
1226
|
def comment_targets; end
|
1227
1227
|
|
1228
|
-
sig { params(flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), message_loc: T.nilable(Prism::Location), read_name: Symbol, write_name: Symbol,
|
1229
|
-
def copy(flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, message_loc: self.message_loc, read_name: self.read_name, write_name: self.write_name,
|
1228
|
+
sig { params(flags: Integer, receiver: T.nilable(Prism::Node), call_operator_loc: T.nilable(Prism::Location), message_loc: T.nilable(Prism::Location), read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Prism::Location, value: Prism::Node, location: Prism::Location).returns(Prism::CallOperatorWriteNode) }
|
1229
|
+
def copy(flags: self.flags, receiver: self.receiver, call_operator_loc: self.call_operator_loc, message_loc: self.message_loc, read_name: self.read_name, write_name: self.write_name, binary_operator: self.binary_operator, binary_operator_loc: self.binary_operator_loc, value: self.value, location: self.location); end
|
1230
1230
|
|
1231
1231
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
1232
1232
|
def deconstruct_keys(keys); end
|
@@ -1736,16 +1736,16 @@ class Prism::ClassVariableOperatorWriteNode < Prism::Node
|
|
1736
1736
|
def name_loc; end
|
1737
1737
|
|
1738
1738
|
sig { returns(Prism::Location) }
|
1739
|
-
def
|
1739
|
+
def binary_operator_loc; end
|
1740
1740
|
|
1741
1741
|
sig { returns(Prism::Node) }
|
1742
1742
|
def value; end
|
1743
1743
|
|
1744
1744
|
sig { returns(Symbol) }
|
1745
|
-
def
|
1745
|
+
def binary_operator; end
|
1746
1746
|
|
1747
|
-
sig { params(source: Prism::Source, name: Symbol, name_loc: Prism::Location,
|
1748
|
-
def initialize(source, name, name_loc,
|
1747
|
+
sig { params(source: Prism::Source, name: Symbol, name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).void }
|
1748
|
+
def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end
|
1749
1749
|
|
1750
1750
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
1751
1751
|
def accept(visitor); end
|
@@ -1762,8 +1762,8 @@ class Prism::ClassVariableOperatorWriteNode < Prism::Node
|
|
1762
1762
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
1763
1763
|
def comment_targets; end
|
1764
1764
|
|
1765
|
-
sig { params(name: Symbol, name_loc: Prism::Location,
|
1766
|
-
def copy(name: self.name, name_loc: self.name_loc,
|
1765
|
+
sig { params(name: Symbol, name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).returns(Prism::ClassVariableOperatorWriteNode) }
|
1766
|
+
def copy(name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator, location: self.location); end
|
1767
1767
|
|
1768
1768
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
1769
1769
|
def deconstruct_keys(keys); end
|
@@ -2036,16 +2036,16 @@ class Prism::ConstantOperatorWriteNode < Prism::Node
|
|
2036
2036
|
def name_loc; end
|
2037
2037
|
|
2038
2038
|
sig { returns(Prism::Location) }
|
2039
|
-
def
|
2039
|
+
def binary_operator_loc; end
|
2040
2040
|
|
2041
2041
|
sig { returns(Prism::Node) }
|
2042
2042
|
def value; end
|
2043
2043
|
|
2044
2044
|
sig { returns(Symbol) }
|
2045
|
-
def
|
2045
|
+
def binary_operator; end
|
2046
2046
|
|
2047
|
-
sig { params(source: Prism::Source, name: Symbol, name_loc: Prism::Location,
|
2048
|
-
def initialize(source, name, name_loc,
|
2047
|
+
sig { params(source: Prism::Source, name: Symbol, name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).void }
|
2048
|
+
def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end
|
2049
2049
|
|
2050
2050
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
2051
2051
|
def accept(visitor); end
|
@@ -2062,8 +2062,8 @@ class Prism::ConstantOperatorWriteNode < Prism::Node
|
|
2062
2062
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
2063
2063
|
def comment_targets; end
|
2064
2064
|
|
2065
|
-
sig { params(name: Symbol, name_loc: Prism::Location,
|
2066
|
-
def copy(name: self.name, name_loc: self.name_loc,
|
2065
|
+
sig { params(name: Symbol, name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).returns(Prism::ConstantOperatorWriteNode) }
|
2066
|
+
def copy(name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator, location: self.location); end
|
2067
2067
|
|
2068
2068
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
2069
2069
|
def deconstruct_keys(keys); end
|
@@ -2246,16 +2246,16 @@ class Prism::ConstantPathOperatorWriteNode < Prism::Node
|
|
2246
2246
|
def target; end
|
2247
2247
|
|
2248
2248
|
sig { returns(Prism::Location) }
|
2249
|
-
def
|
2249
|
+
def binary_operator_loc; end
|
2250
2250
|
|
2251
2251
|
sig { returns(Prism::Node) }
|
2252
2252
|
def value; end
|
2253
2253
|
|
2254
2254
|
sig { returns(Symbol) }
|
2255
|
-
def
|
2255
|
+
def binary_operator; end
|
2256
2256
|
|
2257
|
-
sig { params(source: Prism::Source, target: Prism::ConstantPathNode,
|
2258
|
-
def initialize(source, target,
|
2257
|
+
sig { params(source: Prism::Source, target: Prism::ConstantPathNode, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).void }
|
2258
|
+
def initialize(source, target, binary_operator_loc, value, binary_operator, location); end
|
2259
2259
|
|
2260
2260
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
2261
2261
|
def accept(visitor); end
|
@@ -2272,8 +2272,8 @@ class Prism::ConstantPathOperatorWriteNode < Prism::Node
|
|
2272
2272
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
2273
2273
|
def comment_targets; end
|
2274
2274
|
|
2275
|
-
sig { params(target: Prism::ConstantPathNode,
|
2276
|
-
def copy(target: self.target,
|
2275
|
+
sig { params(target: Prism::ConstantPathNode, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).returns(Prism::ConstantPathOperatorWriteNode) }
|
2276
|
+
def copy(target: self.target, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator, location: self.location); end
|
2277
2277
|
|
2278
2278
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
2279
2279
|
def deconstruct_keys(keys); end
|
@@ -3424,16 +3424,16 @@ class Prism::GlobalVariableOperatorWriteNode < Prism::Node
|
|
3424
3424
|
def name_loc; end
|
3425
3425
|
|
3426
3426
|
sig { returns(Prism::Location) }
|
3427
|
-
def
|
3427
|
+
def binary_operator_loc; end
|
3428
3428
|
|
3429
3429
|
sig { returns(Prism::Node) }
|
3430
3430
|
def value; end
|
3431
3431
|
|
3432
3432
|
sig { returns(Symbol) }
|
3433
|
-
def
|
3433
|
+
def binary_operator; end
|
3434
3434
|
|
3435
|
-
sig { params(source: Prism::Source, name: Symbol, name_loc: Prism::Location,
|
3436
|
-
def initialize(source, name, name_loc,
|
3435
|
+
sig { params(source: Prism::Source, name: Symbol, name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).void }
|
3436
|
+
def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end
|
3437
3437
|
|
3438
3438
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
3439
3439
|
def accept(visitor); end
|
@@ -3450,8 +3450,8 @@ class Prism::GlobalVariableOperatorWriteNode < Prism::Node
|
|
3450
3450
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
3451
3451
|
def comment_targets; end
|
3452
3452
|
|
3453
|
-
sig { params(name: Symbol, name_loc: Prism::Location,
|
3454
|
-
def copy(name: self.name, name_loc: self.name_loc,
|
3453
|
+
sig { params(name: Symbol, name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).returns(Prism::GlobalVariableOperatorWriteNode) }
|
3454
|
+
def copy(name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator, location: self.location); end
|
3455
3455
|
|
3456
3456
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
3457
3457
|
def deconstruct_keys(keys); end
|
@@ -4159,16 +4159,16 @@ class Prism::IndexOperatorWriteNode < Prism::Node
|
|
4159
4159
|
def block; end
|
4160
4160
|
|
4161
4161
|
sig { returns(Symbol) }
|
4162
|
-
def
|
4162
|
+
def binary_operator; end
|
4163
4163
|
|
4164
4164
|
sig { returns(Prism::Location) }
|
4165
|
-
def
|
4165
|
+
def binary_operator_loc; end
|
4166
4166
|
|
4167
4167
|
sig { returns(Prism::Node) }
|
4168
4168
|
def value; end
|
4169
4169
|
|
4170
|
-
sig { params(source: Prism::Source, 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),
|
4171
|
-
def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block,
|
4170
|
+
sig { params(source: Prism::Source, 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, location: Prism::Location).void }
|
4171
|
+
def initialize(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, location); end
|
4172
4172
|
|
4173
4173
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
4174
4174
|
def accept(visitor); end
|
@@ -4185,8 +4185,8 @@ class Prism::IndexOperatorWriteNode < Prism::Node
|
|
4185
4185
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
4186
4186
|
def comment_targets; end
|
4187
4187
|
|
4188
|
-
sig { params(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),
|
4189
|
-
def copy(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,
|
4188
|
+
sig { params(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, location: Prism::Location).returns(Prism::IndexOperatorWriteNode) }
|
4189
|
+
def copy(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, location: self.location); end
|
4190
4190
|
|
4191
4191
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
4192
4192
|
def deconstruct_keys(keys); end
|
@@ -4461,16 +4461,16 @@ class Prism::InstanceVariableOperatorWriteNode < Prism::Node
|
|
4461
4461
|
def name_loc; end
|
4462
4462
|
|
4463
4463
|
sig { returns(Prism::Location) }
|
4464
|
-
def
|
4464
|
+
def binary_operator_loc; end
|
4465
4465
|
|
4466
4466
|
sig { returns(Prism::Node) }
|
4467
4467
|
def value; end
|
4468
4468
|
|
4469
4469
|
sig { returns(Symbol) }
|
4470
|
-
def
|
4470
|
+
def binary_operator; end
|
4471
4471
|
|
4472
|
-
sig { params(source: Prism::Source, name: Symbol, name_loc: Prism::Location,
|
4473
|
-
def initialize(source, name, name_loc,
|
4472
|
+
sig { params(source: Prism::Source, name: Symbol, name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).void }
|
4473
|
+
def initialize(source, name, name_loc, binary_operator_loc, value, binary_operator, location); end
|
4474
4474
|
|
4475
4475
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
4476
4476
|
def accept(visitor); end
|
@@ -4487,8 +4487,8 @@ class Prism::InstanceVariableOperatorWriteNode < Prism::Node
|
|
4487
4487
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
4488
4488
|
def comment_targets; end
|
4489
4489
|
|
4490
|
-
sig { params(name: Symbol, name_loc: Prism::Location,
|
4491
|
-
def copy(name: self.name, name_loc: self.name_loc,
|
4490
|
+
sig { params(name: Symbol, name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, binary_operator: Symbol, location: Prism::Location).returns(Prism::InstanceVariableOperatorWriteNode) }
|
4491
|
+
def copy(name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator, location: self.location); end
|
4492
4492
|
|
4493
4493
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
4494
4494
|
def deconstruct_keys(keys); end
|
@@ -5103,6 +5103,45 @@ class Prism::InterpolatedXStringNode < Prism::Node
|
|
5103
5103
|
def type; end
|
5104
5104
|
end
|
5105
5105
|
|
5106
|
+
# Represents reading from the implicit `it` local variable.
|
5107
|
+
#
|
5108
|
+
# -> { it }
|
5109
|
+
# ^^
|
5110
|
+
class Prism::ItLocalVariableReadNode < Prism::Node
|
5111
|
+
sig { params(source: Prism::Source, location: Prism::Location).void }
|
5112
|
+
def initialize(source, location); end
|
5113
|
+
|
5114
|
+
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
5115
|
+
def accept(visitor); end
|
5116
|
+
|
5117
|
+
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
|
5118
|
+
def child_nodes; end
|
5119
|
+
|
5120
|
+
sig { override.returns(T::Array[T.nilable(Prism::Node)]) }
|
5121
|
+
def deconstruct; end
|
5122
|
+
|
5123
|
+
sig { override.returns(T::Array[Prism::Node]) }
|
5124
|
+
def compact_child_nodes; end
|
5125
|
+
|
5126
|
+
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
5127
|
+
def comment_targets; end
|
5128
|
+
|
5129
|
+
sig { params(location: Prism::Location).returns(Prism::ItLocalVariableReadNode) }
|
5130
|
+
def copy(location: self.location); end
|
5131
|
+
|
5132
|
+
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
5133
|
+
def deconstruct_keys(keys); end
|
5134
|
+
|
5135
|
+
sig { override.returns(T::Array[Prism::Reflection::Field]) }
|
5136
|
+
def fields; end
|
5137
|
+
|
5138
|
+
sig { override.returns(String) }
|
5139
|
+
def inspect; end
|
5140
|
+
|
5141
|
+
sig { override.returns(Symbol) }
|
5142
|
+
def type; end
|
5143
|
+
end
|
5144
|
+
|
5106
5145
|
# Represents an implicit set of parameters through the use of the `it` keyword within a block or lambda.
|
5107
5146
|
#
|
5108
5147
|
# -> { it + it }
|
@@ -5380,7 +5419,7 @@ class Prism::LocalVariableOperatorWriteNode < Prism::Node
|
|
5380
5419
|
def name_loc; end
|
5381
5420
|
|
5382
5421
|
sig { returns(Prism::Location) }
|
5383
|
-
def
|
5422
|
+
def binary_operator_loc; end
|
5384
5423
|
|
5385
5424
|
sig { returns(Prism::Node) }
|
5386
5425
|
def value; end
|
@@ -5389,13 +5428,13 @@ class Prism::LocalVariableOperatorWriteNode < Prism::Node
|
|
5389
5428
|
def name; end
|
5390
5429
|
|
5391
5430
|
sig { returns(Symbol) }
|
5392
|
-
def
|
5431
|
+
def binary_operator; end
|
5393
5432
|
|
5394
5433
|
sig { returns(Integer) }
|
5395
5434
|
def depth; end
|
5396
5435
|
|
5397
|
-
sig { params(source: Prism::Source, name_loc: Prism::Location,
|
5398
|
-
def initialize(source, name_loc,
|
5436
|
+
sig { params(source: Prism::Source, name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, name: Symbol, binary_operator: Symbol, depth: Integer, location: Prism::Location).void }
|
5437
|
+
def initialize(source, name_loc, binary_operator_loc, value, name, binary_operator, depth, location); end
|
5399
5438
|
|
5400
5439
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
5401
5440
|
def accept(visitor); end
|
@@ -5412,8 +5451,8 @@ class Prism::LocalVariableOperatorWriteNode < Prism::Node
|
|
5412
5451
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
5413
5452
|
def comment_targets; end
|
5414
5453
|
|
5415
|
-
sig { params(name_loc: Prism::Location,
|
5416
|
-
def copy(name_loc: self.name_loc,
|
5454
|
+
sig { params(name_loc: Prism::Location, binary_operator_loc: Prism::Location, value: Prism::Node, name: Symbol, binary_operator: Symbol, depth: Integer, location: Prism::Location).returns(Prism::LocalVariableOperatorWriteNode) }
|
5455
|
+
def copy(name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, name: self.name, binary_operator: self.binary_operator, depth: self.depth, location: self.location); end
|
5417
5456
|
|
5418
5457
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
5419
5458
|
def deconstruct_keys(keys); end
|
@@ -6508,7 +6547,7 @@ class Prism::ParametersNode < Prism::Node
|
|
6508
6547
|
sig { returns(T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode))) }
|
6509
6548
|
def rest; end
|
6510
6549
|
|
6511
|
-
sig { returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode)]) }
|
6550
|
+
sig { returns(T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)]) }
|
6512
6551
|
def posts; end
|
6513
6552
|
|
6514
6553
|
sig { returns(T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)]) }
|
@@ -6520,7 +6559,7 @@ class Prism::ParametersNode < Prism::Node
|
|
6520
6559
|
sig { returns(T.nilable(Prism::BlockParameterNode)) }
|
6521
6560
|
def block; end
|
6522
6561
|
|
6523
|
-
sig { params(source: Prism::Source, requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)], optionals: T::Array[Prism::OptionalParameterNode], rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)), posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode)], keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)], keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)), block: T.nilable(Prism::BlockParameterNode), location: Prism::Location).void }
|
6562
|
+
sig { params(source: Prism::Source, requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)], optionals: T::Array[Prism::OptionalParameterNode], rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)), posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)], keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)], keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)), block: T.nilable(Prism::BlockParameterNode), location: Prism::Location).void }
|
6524
6563
|
def initialize(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location); end
|
6525
6564
|
|
6526
6565
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
@@ -6538,7 +6577,7 @@ class Prism::ParametersNode < Prism::Node
|
|
6538
6577
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
6539
6578
|
def comment_targets; end
|
6540
6579
|
|
6541
|
-
sig { params(requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)], optionals: T::Array[Prism::OptionalParameterNode], rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)), posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode)], keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)], keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)), block: T.nilable(Prism::BlockParameterNode), location: Prism::Location).returns(Prism::ParametersNode) }
|
6580
|
+
sig { params(requireds: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode)], optionals: T::Array[Prism::OptionalParameterNode], rest: T.nilable(T.any(Prism::RestParameterNode, Prism::ImplicitRestNode)), posts: T::Array[T.any(Prism::RequiredParameterNode, Prism::MultiTargetNode, Prism::KeywordRestParameterNode, Prism::NoKeywordsParameterNode, Prism::ForwardingParameterNode)], keywords: T::Array[T.any(Prism::RequiredKeywordParameterNode, Prism::OptionalKeywordParameterNode)], keyword_rest: T.nilable(T.any(Prism::KeywordRestParameterNode, Prism::ForwardingParameterNode, Prism::NoKeywordsParameterNode)), block: T.nilable(Prism::BlockParameterNode), location: Prism::Location).returns(Prism::ParametersNode) }
|
6542
6581
|
def copy(requireds: self.requireds, optionals: self.optionals, rest: self.rest, posts: self.posts, keywords: self.keywords, keyword_rest: self.keyword_rest, block: self.block, location: self.location); end
|
6543
6582
|
|
6544
6583
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
@@ -6943,11 +6982,17 @@ end
|
|
6943
6982
|
# 1.0r
|
6944
6983
|
# ^^^^
|
6945
6984
|
class Prism::RationalNode < Prism::Node
|
6946
|
-
sig { returns(
|
6947
|
-
def
|
6985
|
+
sig { returns(Integer) }
|
6986
|
+
def flags; end
|
6948
6987
|
|
6949
|
-
sig {
|
6950
|
-
def
|
6988
|
+
sig { returns(Integer) }
|
6989
|
+
def numerator; end
|
6990
|
+
|
6991
|
+
sig { returns(Integer) }
|
6992
|
+
def denominator; end
|
6993
|
+
|
6994
|
+
sig { params(source: Prism::Source, flags: Integer, numerator: Integer, denominator: Integer, location: Prism::Location).void }
|
6995
|
+
def initialize(source, flags, numerator, denominator, location); end
|
6951
6996
|
|
6952
6997
|
sig { override.params(visitor: Prism::Visitor).returns(T.untyped) }
|
6953
6998
|
def accept(visitor); end
|
@@ -6964,12 +7009,24 @@ class Prism::RationalNode < Prism::Node
|
|
6964
7009
|
sig { override.returns(T::Array[T.any(Prism::Node, Prism::Location)]) }
|
6965
7010
|
def comment_targets; end
|
6966
7011
|
|
6967
|
-
sig { params(
|
6968
|
-
def copy(
|
7012
|
+
sig { params(flags: Integer, numerator: Integer, denominator: Integer, location: Prism::Location).returns(Prism::RationalNode) }
|
7013
|
+
def copy(flags: self.flags, numerator: self.numerator, denominator: self.denominator, location: self.location); end
|
6969
7014
|
|
6970
7015
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
6971
7016
|
def deconstruct_keys(keys); end
|
6972
7017
|
|
7018
|
+
sig { returns(T::Boolean) }
|
7019
|
+
def binary?; end
|
7020
|
+
|
7021
|
+
sig { returns(T::Boolean) }
|
7022
|
+
def decimal?; end
|
7023
|
+
|
7024
|
+
sig { returns(T::Boolean) }
|
7025
|
+
def octal?; end
|
7026
|
+
|
7027
|
+
sig { returns(T::Boolean) }
|
7028
|
+
def hexadecimal?; end
|
7029
|
+
|
6973
7030
|
sig { override.returns(T::Array[Prism::Reflection::Field]) }
|
6974
7031
|
def fields; end
|
6975
7032
|
|
data/rbi/prism/node_ext.rbi
CHANGED
@@ -100,3 +100,8 @@ class Prism::ParametersNode < Prism::Node
|
|
100
100
|
sig { returns(T::Array[T.any([Symbol, Symbol], [Symbol])]) }
|
101
101
|
def signature; end
|
102
102
|
end
|
103
|
+
|
104
|
+
class Prism::CallNode < Prism::Node
|
105
|
+
sig { returns(T.nilable(Prism::Location)) }
|
106
|
+
def full_message_loc; end
|
107
|
+
end
|
data/rbi/prism/parse_result.rbi
CHANGED
data/rbi/prism/visitor.rbi
CHANGED
@@ -279,6 +279,9 @@ class Prism::Visitor < Prism::BasicVisitor
|
|
279
279
|
sig { params(node: Prism::InterpolatedXStringNode).void }
|
280
280
|
def visit_interpolated_x_string_node(node); end
|
281
281
|
|
282
|
+
sig { params(node: Prism::ItLocalVariableReadNode).void }
|
283
|
+
def visit_it_local_variable_read_node(node); end
|
284
|
+
|
282
285
|
sig { params(node: Prism::ItParametersNode).void }
|
283
286
|
def visit_it_parameters_node(node); end
|
284
287
|
|
data/rbi/prism.rbi
CHANGED
@@ -28,6 +28,12 @@ module Prism
|
|
28
28
|
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(String, 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
29
|
def self.parse_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
|
30
30
|
|
31
|
+
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)).void }
|
32
|
+
def self.profile(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
|
33
|
+
|
34
|
+
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(String, 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
|
36
|
+
|
31
37
|
sig { params(stream: T.any(IO, StringIO), 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(Prism::ParseResult) }
|
32
38
|
def self.parse_stream(stream, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, scopes: nil, version: nil); end
|
33
39
|
|
data/sig/prism/dsl.rbs
CHANGED
@@ -67,7 +67,7 @@ module Prism
|
|
67
67
|
def CallNode: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Symbol name, Location? message_loc, Location? opening_loc, ArgumentsNode? arguments, Location? closing_loc, Prism::node? block, ?Source source, ?Location location) -> CallNode
|
68
68
|
|
69
69
|
# Create a new CallOperatorWriteNode node
|
70
|
-
def CallOperatorWriteNode: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol
|
70
|
+
def CallOperatorWriteNode: (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, ?Source source, ?Location location) -> CallOperatorWriteNode
|
71
71
|
|
72
72
|
# Create a new CallOrWriteNode node
|
73
73
|
def CallOrWriteNode: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> CallOrWriteNode
|
@@ -91,7 +91,7 @@ module Prism
|
|
91
91
|
def ClassVariableAndWriteNode: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> ClassVariableAndWriteNode
|
92
92
|
|
93
93
|
# Create a new ClassVariableOperatorWriteNode node
|
94
|
-
def ClassVariableOperatorWriteNode: (Symbol name, Location name_loc, Location
|
94
|
+
def ClassVariableOperatorWriteNode: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, ?Source source, ?Location location) -> ClassVariableOperatorWriteNode
|
95
95
|
|
96
96
|
# Create a new ClassVariableOrWriteNode node
|
97
97
|
def ClassVariableOrWriteNode: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> ClassVariableOrWriteNode
|
@@ -109,7 +109,7 @@ module Prism
|
|
109
109
|
def ConstantAndWriteNode: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> ConstantAndWriteNode
|
110
110
|
|
111
111
|
# Create a new ConstantOperatorWriteNode node
|
112
|
-
def ConstantOperatorWriteNode: (Symbol name, Location name_loc, Location
|
112
|
+
def ConstantOperatorWriteNode: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, ?Source source, ?Location location) -> ConstantOperatorWriteNode
|
113
113
|
|
114
114
|
# Create a new ConstantOrWriteNode node
|
115
115
|
def ConstantOrWriteNode: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> ConstantOrWriteNode
|
@@ -121,7 +121,7 @@ module Prism
|
|
121
121
|
def ConstantPathNode: (Prism::node? parent, Symbol? name, Location delimiter_loc, Location name_loc, ?Source source, ?Location location) -> ConstantPathNode
|
122
122
|
|
123
123
|
# Create a new ConstantPathOperatorWriteNode node
|
124
|
-
def ConstantPathOperatorWriteNode: (ConstantPathNode target, Location
|
124
|
+
def ConstantPathOperatorWriteNode: (ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator, ?Source source, ?Location location) -> ConstantPathOperatorWriteNode
|
125
125
|
|
126
126
|
# Create a new ConstantPathOrWriteNode node
|
127
127
|
def ConstantPathOrWriteNode: (ConstantPathNode target, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> ConstantPathOrWriteNode
|
@@ -187,7 +187,7 @@ module Prism
|
|
187
187
|
def GlobalVariableAndWriteNode: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> GlobalVariableAndWriteNode
|
188
188
|
|
189
189
|
# Create a new GlobalVariableOperatorWriteNode node
|
190
|
-
def GlobalVariableOperatorWriteNode: (Symbol name, Location name_loc, Location
|
190
|
+
def GlobalVariableOperatorWriteNode: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, ?Source source, ?Location location) -> GlobalVariableOperatorWriteNode
|
191
191
|
|
192
192
|
# Create a new GlobalVariableOrWriteNode node
|
193
193
|
def GlobalVariableOrWriteNode: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> GlobalVariableOrWriteNode
|
@@ -226,7 +226,7 @@ module Prism
|
|
226
226
|
def IndexAndWriteNode: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> IndexAndWriteNode
|
227
227
|
|
228
228
|
# Create a new IndexOperatorWriteNode node
|
229
|
-
def IndexOperatorWriteNode: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Symbol
|
229
|
+
def IndexOperatorWriteNode: (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, ?Source source, ?Location location) -> IndexOperatorWriteNode
|
230
230
|
|
231
231
|
# Create a new IndexOrWriteNode node
|
232
232
|
def IndexOrWriteNode: (Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> IndexOrWriteNode
|
@@ -238,7 +238,7 @@ module Prism
|
|
238
238
|
def InstanceVariableAndWriteNode: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> InstanceVariableAndWriteNode
|
239
239
|
|
240
240
|
# Create a new InstanceVariableOperatorWriteNode node
|
241
|
-
def InstanceVariableOperatorWriteNode: (Symbol name, Location name_loc, Location
|
241
|
+
def InstanceVariableOperatorWriteNode: (Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, ?Source source, ?Location location) -> InstanceVariableOperatorWriteNode
|
242
242
|
|
243
243
|
# Create a new InstanceVariableOrWriteNode node
|
244
244
|
def InstanceVariableOrWriteNode: (Symbol name, Location name_loc, Location operator_loc, Prism::node value, ?Source source, ?Location location) -> InstanceVariableOrWriteNode
|
@@ -270,6 +270,9 @@ module Prism
|
|
270
270
|
# Create a new InterpolatedXStringNode node
|
271
271
|
def InterpolatedXStringNode: (Location opening_loc, Array[StringNode | EmbeddedStatementsNode | EmbeddedVariableNode] parts, Location closing_loc, ?Source source, ?Location location) -> InterpolatedXStringNode
|
272
272
|
|
273
|
+
# Create a new ItLocalVariableReadNode node
|
274
|
+
def ItLocalVariableReadNode: (?Source source, ?Location location) -> ItLocalVariableReadNode
|
275
|
+
|
273
276
|
# Create a new ItParametersNode node
|
274
277
|
def ItParametersNode: (?Source source, ?Location location) -> ItParametersNode
|
275
278
|
|
@@ -286,7 +289,7 @@ module Prism
|
|
286
289
|
def LocalVariableAndWriteNode: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, ?Source source, ?Location location) -> LocalVariableAndWriteNode
|
287
290
|
|
288
291
|
# Create a new LocalVariableOperatorWriteNode node
|
289
|
-
def LocalVariableOperatorWriteNode: (Location name_loc, Location
|
292
|
+
def LocalVariableOperatorWriteNode: (Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth, ?Source source, ?Location location) -> LocalVariableOperatorWriteNode
|
290
293
|
|
291
294
|
# Create a new LocalVariableOrWriteNode node
|
292
295
|
def LocalVariableOrWriteNode: (Location name_loc, Location operator_loc, Prism::node value, Symbol name, Integer depth, ?Source source, ?Location location) -> LocalVariableOrWriteNode
|
@@ -349,7 +352,7 @@ module Prism
|
|
349
352
|
def OrNode: (Prism::node left, Prism::node right, Location operator_loc, ?Source source, ?Location location) -> OrNode
|
350
353
|
|
351
354
|
# Create a new ParametersNode node
|
352
|
-
def ParametersNode: (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, ?Source source, ?Location location) -> ParametersNode
|
355
|
+
def ParametersNode: (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, ?Source source, ?Location location) -> ParametersNode
|
353
356
|
|
354
357
|
# Create a new ParenthesesNode node
|
355
358
|
def ParenthesesNode: (Prism::node? body, Location opening_loc, Location closing_loc, ?Source source, ?Location location) -> ParenthesesNode
|
@@ -373,7 +376,7 @@ module Prism
|
|
373
376
|
def RangeNode: (Integer flags, Prism::node? left, Prism::node? right, Location operator_loc, ?Source source, ?Location location) -> RangeNode
|
374
377
|
|
375
378
|
# Create a new RationalNode node
|
376
|
-
def RationalNode: (
|
379
|
+
def RationalNode: (Integer flags, Integer numerator, Integer denominator, ?Source source, ?Location location) -> RationalNode
|
377
380
|
|
378
381
|
# Create a new RedoNode node
|
379
382
|
def RedoNode: (?Source source, ?Location location) -> RedoNode
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Prism
|
2
|
+
class LexCompat
|
3
|
+
class Result < Prism::Result
|
4
|
+
attr_reader value: Array[[[Integer, Integer], Symbol, String, untyped]]
|
5
|
+
|
6
|
+
def initialize: (Array[[[Integer, Integer], Symbol, String, untyped]] value, Array[comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void
|
7
|
+
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -91,6 +91,7 @@ module Prism
|
|
91
91
|
def visit_interpolated_string_node: (InterpolatedStringNode) -> node?
|
92
92
|
def visit_interpolated_symbol_node: (InterpolatedSymbolNode) -> node?
|
93
93
|
def visit_interpolated_x_string_node: (InterpolatedXStringNode) -> node?
|
94
|
+
def visit_it_local_variable_read_node: (ItLocalVariableReadNode) -> node?
|
94
95
|
def visit_it_parameters_node: (ItParametersNode) -> node?
|
95
96
|
def visit_keyword_hash_node: (KeywordHashNode) -> node?
|
96
97
|
def visit_keyword_rest_parameter_node: (KeywordRestParameterNode) -> node?
|