The DSL
module provides a set of methods that can be used to create prism nodes in a more concise manner. For example, instead of writing:
source = Prism::Source.for("[1]") Prism::ArrayNode.new( [ Prism::IntegerNode.new( Prism::IntegerBaseFlags::DECIMAL, 1, Prism::Location.new(source, 1, 1), source ) ], Prism::Location.new(source, 0, 1), Prism::Location.new(source, 2, 1), source )
you could instead write:
source = Prism::Source.for("[1]") ArrayNode( IntegerNode(Prism::IntegerBaseFlags::DECIMAL, 1, Location(source, 1, 1)), source), Location(source, 0, 1), Location(source, 2, 1), source )
This is mostly helpful in the context of writing tests, but can also be used to generate trees programmatically.
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 51
def AliasGlobalVariableNode(new_name, old_name, keyword_loc, source = nil, location = Location())
AliasGlobalVariableNode.new(source, new_name, old_name, keyword_loc, location)
end
Create a new AliasGlobalVariableNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 56
def AliasMethodNode(new_name, old_name, keyword_loc, source = nil, location = Location())
AliasMethodNode.new(source, new_name, old_name, keyword_loc, location)
end
Create a new AliasMethodNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 61
def AlternationPatternNode(left, right, operator_loc, source = nil, location = Location())
AlternationPatternNode.new(source, left, right, operator_loc, location)
end
Create a new AlternationPatternNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 66
def AndNode(left, right, operator_loc, source = nil, location = Location())
AndNode.new(source, left, right, operator_loc, location)
end
Create a new AndNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 71
def ArgumentsNode(flags, arguments, source = nil, location = Location())
ArgumentsNode.new(source, flags, arguments, location)
end
Create a new ArgumentsNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 76
def ArrayNode(flags, elements, opening_loc, closing_loc, source = nil, location = Location())
ArrayNode.new(source, flags, elements, opening_loc, closing_loc, location)
end
Create a new ArrayNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 81
def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, source = nil, location = Location())
ArrayPatternNode.new(source, constant, requireds, rest, posts, opening_loc, closing_loc, location)
end
Create a new ArrayPatternNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 86
def AssocNode(key, value, operator_loc, source = nil, location = Location())
AssocNode.new(source, key, value, operator_loc, location)
end
Create a new AssocNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 91
def AssocSplatNode(value, operator_loc, source = nil, location = Location())
AssocSplatNode.new(source, value, operator_loc, location)
end
Create a new AssocSplatNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 96
def BackReferenceReadNode(name, source = nil, location = Location())
BackReferenceReadNode.new(source, name, location)
end
Create a new BackReferenceReadNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 101
def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, source = nil, location = Location())
BeginNode.new(source, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location)
end
Create a new BeginNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 106
def BlockArgumentNode(expression, operator_loc, source = nil, location = Location())
BlockArgumentNode.new(source, expression, operator_loc, location)
end
Create a new BlockArgumentNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 111
def BlockLocalVariableNode(flags, name, source = nil, location = Location())
BlockLocalVariableNode.new(source, flags, name, location)
end
Create a new BlockLocalVariableNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 116
def BlockNode(locals, parameters, body, opening_loc, closing_loc, source = nil, location = Location())
BlockNode.new(source, locals, parameters, body, opening_loc, closing_loc, location)
end
Create a new BlockNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 121
def BlockParameterNode(flags, name, name_loc, operator_loc, source = nil, location = Location())
BlockParameterNode.new(source, flags, name, name_loc, operator_loc, location)
end
Create a new BlockParameterNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 126
def BlockParametersNode(parameters, locals, opening_loc, closing_loc, source = nil, location = Location())
BlockParametersNode.new(source, parameters, locals, opening_loc, closing_loc, location)
end
Create a new BlockParametersNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 131
def BreakNode(arguments, keyword_loc, source = nil, location = Location())
BreakNode.new(source, arguments, keyword_loc, location)
end
Create a new BreakNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 136
def CallAndWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = nil, location = Location())
CallAndWriteNode.new(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location)
end
Create a new CallAndWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 141
def CallNode(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, source = nil, location = Location())
CallNode.new(source, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location)
end
Create a new CallNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 146
def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, source = nil, location = Location())
CallOperatorWriteNode.new(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value, location)
end
Create a new CallOperatorWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 151
def CallOrWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, source = nil, location = Location())
CallOrWriteNode.new(source, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location)
end
Create a new CallOrWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 156
def CallTargetNode(flags, receiver, call_operator_loc, name, message_loc, source = nil, location = Location())
CallTargetNode.new(source, flags, receiver, call_operator_loc, name, message_loc, location)
end
Create a new CallTargetNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 161
def CapturePatternNode(value, target, operator_loc, source = nil, location = Location())
CapturePatternNode.new(source, value, target, operator_loc, location)
end
Create a new CapturePatternNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 166
def CaseMatchNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = nil, location = Location())
CaseMatchNode.new(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location)
end
Create a new CaseMatchNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 171
def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, source = nil, location = Location())
CaseNode.new(source, predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location)
end
Create a new CaseNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 176
def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, source = nil, location = Location())
ClassNode.new(source, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location)
end
Create a new ClassNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 181
def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
ClassVariableAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
end
Create a new ClassVariableAndWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 186
def ClassVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = nil, location = Location())
ClassVariableOperatorWriteNode.new(source, name, name_loc, binary_operator_loc, value, binary_operator, location)
end
Create a new ClassVariableOperatorWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 191
def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
ClassVariableOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
end
Create a new ClassVariableOrWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 196
def ClassVariableReadNode(name, source = nil, location = Location())
ClassVariableReadNode.new(source, name, location)
end
Create a new ClassVariableReadNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 201
def ClassVariableTargetNode(name, source = nil, location = Location())
ClassVariableTargetNode.new(source, name, location)
end
Create a new ClassVariableTargetNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 206
def ClassVariableWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
ClassVariableWriteNode.new(source, name, name_loc, value, operator_loc, location)
end
Create a new ClassVariableWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 211
def ConstantAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
ConstantAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
end
Create a new ConstantAndWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 216
def ConstantOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = nil, location = Location())
ConstantOperatorWriteNode.new(source, name, name_loc, binary_operator_loc, value, binary_operator, location)
end
Create a new ConstantOperatorWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 221
def ConstantOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
ConstantOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
end
Create a new ConstantOrWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 226
def ConstantPathAndWriteNode(target, operator_loc, value, source = nil, location = Location())
ConstantPathAndWriteNode.new(source, target, operator_loc, value, location)
end
Create a new ConstantPathAndWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 231
def ConstantPathNode(parent, name, delimiter_loc, name_loc, source = nil, location = Location())
ConstantPathNode.new(source, parent, name, delimiter_loc, name_loc, location)
end
Create a new ConstantPathNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 236
def ConstantPathOperatorWriteNode(target, binary_operator_loc, value, binary_operator, source = nil, location = Location())
ConstantPathOperatorWriteNode.new(source, target, binary_operator_loc, value, binary_operator, location)
end
Create a new ConstantPathOperatorWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 241
def ConstantPathOrWriteNode(target, operator_loc, value, source = nil, location = Location())
ConstantPathOrWriteNode.new(source, target, operator_loc, value, location)
end
Create a new ConstantPathOrWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 246
def ConstantPathTargetNode(parent, name, delimiter_loc, name_loc, source = nil, location = Location())
ConstantPathTargetNode.new(source, parent, name, delimiter_loc, name_loc, location)
end
Create a new ConstantPathTargetNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 251
def ConstantPathWriteNode(target, operator_loc, value, source = nil, location = Location())
ConstantPathWriteNode.new(source, target, operator_loc, value, location)
end
Create a new ConstantPathWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 256
def ConstantReadNode(name, source = nil, location = Location())
ConstantReadNode.new(source, name, location)
end
Create a new ConstantReadNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 261
def ConstantTargetNode(name, source = nil, location = Location())
ConstantTargetNode.new(source, name, location)
end
Create a new ConstantTargetNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 266
def ConstantWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
ConstantWriteNode.new(source, name, name_loc, value, operator_loc, location)
end
Create a new ConstantWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 271
def DefNode(name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, source = nil, location = Location())
DefNode.new(source, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location)
end
Create a new DefNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 276
def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, source = nil, location = Location())
DefinedNode.new(source, lparen_loc, value, rparen_loc, keyword_loc, location)
end
Create a new DefinedNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 281
def ElseNode(else_keyword_loc, statements, end_keyword_loc, source = nil, location = Location())
ElseNode.new(source, else_keyword_loc, statements, end_keyword_loc, location)
end
Create a new ElseNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 286
def EmbeddedStatementsNode(opening_loc, statements, closing_loc, source = nil, location = Location())
EmbeddedStatementsNode.new(source, opening_loc, statements, closing_loc, location)
end
Create a new EmbeddedStatementsNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 291
def EmbeddedVariableNode(operator_loc, variable, source = nil, location = Location())
EmbeddedVariableNode.new(source, operator_loc, variable, location)
end
Create a new EmbeddedVariableNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 296
def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, source = nil, location = Location())
EnsureNode.new(source, ensure_keyword_loc, statements, end_keyword_loc, location)
end
Create a new EnsureNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 301
def FalseNode(source = nil, location = Location())
FalseNode.new(source, location)
end
Create a new FalseNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 306
def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, source = nil, location = Location())
FindPatternNode.new(source, constant, left, requireds, right, opening_loc, closing_loc, location)
end
Create a new FindPatternNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 311
def FlipFlopNode(flags, left, right, operator_loc, source = nil, location = Location())
FlipFlopNode.new(source, flags, left, right, operator_loc, location)
end
Create a new FlipFlopNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 316
def FloatNode(value, source = nil, location = Location())
FloatNode.new(source, value, location)
end
Create a new FloatNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 321
def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, source = nil, location = Location())
ForNode.new(source, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location)
end
Create a new ForNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 326
def ForwardingArgumentsNode(source = nil, location = Location())
ForwardingArgumentsNode.new(source, location)
end
Create a new ForwardingArgumentsNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 331
def ForwardingParameterNode(source = nil, location = Location())
ForwardingParameterNode.new(source, location)
end
Create a new ForwardingParameterNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 336
def ForwardingSuperNode(block, source = nil, location = Location())
ForwardingSuperNode.new(source, block, location)
end
Create a new ForwardingSuperNode
node
GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 341
def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
GlobalVariableAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
end
Create a new GlobalVariableAndWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 346
def GlobalVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = nil, location = Location())
GlobalVariableOperatorWriteNode.new(source, name, name_loc, binary_operator_loc, value, binary_operator, location)
end
Create a new GlobalVariableOperatorWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 351
def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
GlobalVariableOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
end
Create a new GlobalVariableOrWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 356
def GlobalVariableReadNode(name, source = nil, location = Location())
GlobalVariableReadNode.new(source, name, location)
end
Create a new GlobalVariableReadNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 361
def GlobalVariableTargetNode(name, source = nil, location = Location())
GlobalVariableTargetNode.new(source, name, location)
end
Create a new GlobalVariableTargetNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 366
def GlobalVariableWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
GlobalVariableWriteNode.new(source, name, name_loc, value, operator_loc, location)
end
Create a new GlobalVariableWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 371
def HashNode(opening_loc, elements, closing_loc, source = nil, location = Location())
HashNode.new(source, opening_loc, elements, closing_loc, location)
end
Create a new HashNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 376
def HashPatternNode(constant, elements, rest, opening_loc, closing_loc, source = nil, location = Location())
HashPatternNode.new(source, constant, elements, rest, opening_loc, closing_loc, location)
end
Create a new HashPatternNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 381
def IfNode(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = nil, location = Location())
IfNode.new(source, if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location)
end
Create a new IfNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 386
def ImaginaryNode(numeric, source = nil, location = Location())
ImaginaryNode.new(source, numeric, location)
end
Create a new ImaginaryNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 391
def ImplicitNode(value, source = nil, location = Location())
ImplicitNode.new(source, value, location)
end
Create a new ImplicitNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 396
def ImplicitRestNode(source = nil, location = Location())
ImplicitRestNode.new(source, location)
end
Create a new ImplicitRestNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 401
def InNode(pattern, statements, in_loc, then_loc, source = nil, location = Location())
InNode.new(source, pattern, statements, in_loc, then_loc, location)
end
Create a new InNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 406
def IndexAndWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = nil, location = Location())
IndexAndWriteNode.new(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location)
end
Create a new IndexAndWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 411
def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, source = nil, location = Location())
IndexOperatorWriteNode.new(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value, location)
end
Create a new IndexOperatorWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 416
def IndexOrWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, source = nil, location = Location())
IndexOrWriteNode.new(source, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location)
end
Create a new IndexOrWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 421
def IndexTargetNode(flags, receiver, opening_loc, arguments, closing_loc, block, source = nil, location = Location())
IndexTargetNode.new(source, flags, receiver, opening_loc, arguments, closing_loc, block, location)
end
Create a new IndexTargetNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 426
def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
InstanceVariableAndWriteNode.new(source, name, name_loc, operator_loc, value, location)
end
Create a new InstanceVariableAndWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 431
def InstanceVariableOperatorWriteNode(name, name_loc, binary_operator_loc, value, binary_operator, source = nil, location = Location())
InstanceVariableOperatorWriteNode.new(source, name, name_loc, binary_operator_loc, value, binary_operator, location)
end
Create a new InstanceVariableOperatorWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 436
def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, source = nil, location = Location())
InstanceVariableOrWriteNode.new(source, name, name_loc, operator_loc, value, location)
end
Create a new InstanceVariableOrWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 441
def InstanceVariableReadNode(name, source = nil, location = Location())
InstanceVariableReadNode.new(source, name, location)
end
Create a new InstanceVariableReadNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 446
def InstanceVariableTargetNode(name, source = nil, location = Location())
InstanceVariableTargetNode.new(source, name, location)
end
Create a new InstanceVariableTargetNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 451
def InstanceVariableWriteNode(name, name_loc, value, operator_loc, source = nil, location = Location())
InstanceVariableWriteNode.new(source, name, name_loc, value, operator_loc, location)
end
Create a new InstanceVariableWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 456
def IntegerNode(flags, value, source = nil, location = Location())
IntegerNode.new(source, flags, value, location)
end
Create a new IntegerNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 461
def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, source = nil, location = Location())
InterpolatedMatchLastLineNode.new(source, flags, opening_loc, parts, closing_loc, location)
end
Create a new InterpolatedMatchLastLineNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 466
def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, source = nil, location = Location())
InterpolatedRegularExpressionNode.new(source, flags, opening_loc, parts, closing_loc, location)
end
Create a new InterpolatedRegularExpressionNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 471
def InterpolatedStringNode(flags, opening_loc, parts, closing_loc, source = nil, location = Location())
InterpolatedStringNode.new(source, flags, opening_loc, parts, closing_loc, location)
end
Create a new InterpolatedStringNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 476
def InterpolatedSymbolNode(opening_loc, parts, closing_loc, source = nil, location = Location())
InterpolatedSymbolNode.new(source, opening_loc, parts, closing_loc, location)
end
Create a new InterpolatedSymbolNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 481
def InterpolatedXStringNode(opening_loc, parts, closing_loc, source = nil, location = Location())
InterpolatedXStringNode.new(source, opening_loc, parts, closing_loc, location)
end
Create a new InterpolatedXStringNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 486
def ItParametersNode(source = nil, location = Location())
ItParametersNode.new(source, location)
end
Create a new ItParametersNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 491
def KeywordHashNode(flags, elements, source = nil, location = Location())
KeywordHashNode.new(source, flags, elements, location)
end
Create a new KeywordHashNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 496
def KeywordRestParameterNode(flags, name, name_loc, operator_loc, source = nil, location = Location())
KeywordRestParameterNode.new(source, flags, name, name_loc, operator_loc, location)
end
Create a new KeywordRestParameterNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 501
def LambdaNode(locals, operator_loc, opening_loc, closing_loc, parameters, body, source = nil, location = Location())
LambdaNode.new(source, locals, operator_loc, opening_loc, closing_loc, parameters, body, location)
end
Create a new LambdaNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 506
def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, source = nil, location = Location())
LocalVariableAndWriteNode.new(source, name_loc, operator_loc, value, name, depth, location)
end
Create a new LocalVariableAndWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 511
def LocalVariableOperatorWriteNode(name_loc, binary_operator_loc, value, name, binary_operator, depth, source = nil, location = Location())
LocalVariableOperatorWriteNode.new(source, name_loc, binary_operator_loc, value, name, binary_operator, depth, location)
end
Create a new LocalVariableOperatorWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 516
def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, source = nil, location = Location())
LocalVariableOrWriteNode.new(source, name_loc, operator_loc, value, name, depth, location)
end
Create a new LocalVariableOrWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 521
def LocalVariableReadNode(name, depth, source = nil, location = Location())
LocalVariableReadNode.new(source, name, depth, location)
end
Create a new LocalVariableReadNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 526
def LocalVariableTargetNode(name, depth, source = nil, location = Location())
LocalVariableTargetNode.new(source, name, depth, location)
end
Create a new LocalVariableTargetNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 531
def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, source = nil, location = Location())
LocalVariableWriteNode.new(source, name, depth, name_loc, value, operator_loc, location)
end
Create a new LocalVariableWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 46
def Location(source = nil, start_offset = 0, length = 0)
Location.new(source, start_offset, length) # steep:ignore
end
Create a new Location
object
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 536
def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
MatchLastLineNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
end
Create a new MatchLastLineNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 541
def MatchPredicateNode(value, pattern, operator_loc, source = nil, location = Location())
MatchPredicateNode.new(source, value, pattern, operator_loc, location)
end
Create a new MatchPredicateNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 546
def MatchRequiredNode(value, pattern, operator_loc, source = nil, location = Location())
MatchRequiredNode.new(source, value, pattern, operator_loc, location)
end
Create a new MatchRequiredNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 551
def MatchWriteNode(call, targets, source = nil, location = Location())
MatchWriteNode.new(source, call, targets, location)
end
Create a new MatchWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 556
def MissingNode(source = nil, location = Location())
MissingNode.new(source, location)
end
Create a new MissingNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 561
def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, source = nil, location = Location())
ModuleNode.new(source, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location)
end
Create a new ModuleNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 566
def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, source = nil, location = Location())
MultiTargetNode.new(source, lefts, rest, rights, lparen_loc, rparen_loc, location)
end
Create a new MultiTargetNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 571
def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, source = nil, location = Location())
MultiWriteNode.new(source, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location)
end
Create a new MultiWriteNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 576
def NextNode(arguments, keyword_loc, source = nil, location = Location())
NextNode.new(source, arguments, keyword_loc, location)
end
Create a new NextNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 581
def NilNode(source = nil, location = Location())
NilNode.new(source, location)
end
Create a new NilNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 586
def NoKeywordsParameterNode(operator_loc, keyword_loc, source = nil, location = Location())
NoKeywordsParameterNode.new(source, operator_loc, keyword_loc, location)
end
Create a new NoKeywordsParameterNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 591
def NumberedParametersNode(maximum, source = nil, location = Location())
NumberedParametersNode.new(source, maximum, location)
end
Create a new NumberedParametersNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 596
def NumberedReferenceReadNode(number, source = nil, location = Location())
NumberedReferenceReadNode.new(source, number, location)
end
Create a new NumberedReferenceReadNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 601
def OptionalKeywordParameterNode(flags, name, name_loc, value, source = nil, location = Location())
OptionalKeywordParameterNode.new(source, flags, name, name_loc, value, location)
end
Create a new OptionalKeywordParameterNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 606
def OptionalParameterNode(flags, name, name_loc, operator_loc, value, source = nil, location = Location())
OptionalParameterNode.new(source, flags, name, name_loc, operator_loc, value, location)
end
Create a new OptionalParameterNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 611
def OrNode(left, right, operator_loc, source = nil, location = Location())
OrNode.new(source, left, right, operator_loc, location)
end
Create a new OrNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 616
def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, source = nil, location = Location())
ParametersNode.new(source, requireds, optionals, rest, posts, keywords, keyword_rest, block, location)
end
Create a new ParametersNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 621
def ParenthesesNode(body, opening_loc, closing_loc, source = nil, location = Location())
ParenthesesNode.new(source, body, opening_loc, closing_loc, location)
end
Create a new ParenthesesNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 626
def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, source = nil, location = Location())
PinnedExpressionNode.new(source, expression, operator_loc, lparen_loc, rparen_loc, location)
end
Create a new PinnedExpressionNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 631
def PinnedVariableNode(variable, operator_loc, source = nil, location = Location())
PinnedVariableNode.new(source, variable, operator_loc, location)
end
Create a new PinnedVariableNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 636
def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = nil, location = Location())
PostExecutionNode.new(source, statements, keyword_loc, opening_loc, closing_loc, location)
end
Create a new PostExecutionNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 641
def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, source = nil, location = Location())
PreExecutionNode.new(source, statements, keyword_loc, opening_loc, closing_loc, location)
end
Create a new PreExecutionNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 646
def ProgramNode(locals, statements, source = nil, location = Location())
ProgramNode.new(source, locals, statements, location)
end
Create a new ProgramNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 651
def RangeNode(flags, left, right, operator_loc, source = nil, location = Location())
RangeNode.new(source, flags, left, right, operator_loc, location)
end
Create a new RangeNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 656
def RationalNode(numeric, source = nil, location = Location())
RationalNode.new(source, numeric, location)
end
Create a new RationalNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 661
def RedoNode(source = nil, location = Location())
RedoNode.new(source, location)
end
Create a new RedoNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 666
def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
RegularExpressionNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
end
Create a new RegularExpressionNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 671
def RequiredKeywordParameterNode(flags, name, name_loc, source = nil, location = Location())
RequiredKeywordParameterNode.new(source, flags, name, name_loc, location)
end
Create a new RequiredKeywordParameterNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 676
def RequiredParameterNode(flags, name, source = nil, location = Location())
RequiredParameterNode.new(source, flags, name, location)
end
Create a new RequiredParameterNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 681
def RescueModifierNode(expression, keyword_loc, rescue_expression, source = nil, location = Location())
RescueModifierNode.new(source, expression, keyword_loc, rescue_expression, location)
end
Create a new RescueModifierNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 686
def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, source = nil, location = Location())
RescueNode.new(source, keyword_loc, exceptions, operator_loc, reference, statements, consequent, location)
end
Create a new RescueNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 691
def RestParameterNode(flags, name, name_loc, operator_loc, source = nil, location = Location())
RestParameterNode.new(source, flags, name, name_loc, operator_loc, location)
end
Create a new RestParameterNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 696
def RetryNode(source = nil, location = Location())
RetryNode.new(source, location)
end
Create a new RetryNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 701
def ReturnNode(flags, keyword_loc, arguments, source = nil, location = Location())
ReturnNode.new(source, flags, keyword_loc, arguments, location)
end
Create a new ReturnNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 706
def SelfNode(source = nil, location = Location())
SelfNode.new(source, location)
end
Create a new SelfNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 711
def ShareableConstantNode(flags, write, source = nil, location = Location())
ShareableConstantNode.new(source, flags, write, location)
end
Create a new ShareableConstantNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 716
def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, source = nil, location = Location())
SingletonClassNode.new(source, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location)
end
Create a new SingletonClassNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 721
def SourceEncodingNode(source = nil, location = Location())
SourceEncodingNode.new(source, location)
end
Create a new SourceEncodingNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 726
def SourceFileNode(flags, filepath, source = nil, location = Location())
SourceFileNode.new(source, flags, filepath, location)
end
Create a new SourceFileNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 731
def SourceLineNode(source = nil, location = Location())
SourceLineNode.new(source, location)
end
Create a new SourceLineNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 736
def SplatNode(operator_loc, expression, source = nil, location = Location())
SplatNode.new(source, operator_loc, expression, location)
end
Create a new SplatNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 741
def StatementsNode(body, source = nil, location = Location())
StatementsNode.new(source, body, location)
end
Create a new StatementsNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 746
def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
StringNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
end
Create a new StringNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 751
def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, source = nil, location = Location())
SuperNode.new(source, keyword_loc, lparen_loc, arguments, rparen_loc, block, location)
end
Create a new SuperNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 756
def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, source = nil, location = Location())
SymbolNode.new(source, flags, opening_loc, value_loc, closing_loc, unescaped, location)
end
Create a new SymbolNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 761
def TrueNode(source = nil, location = Location())
TrueNode.new(source, location)
end
Create a new TrueNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 766
def UndefNode(names, keyword_loc, source = nil, location = Location())
UndefNode.new(source, names, keyword_loc, location)
end
Create a new UndefNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 771
def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, source = nil, location = Location())
UnlessNode.new(source, keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location)
end
Create a new UnlessNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 776
def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, source = nil, location = Location())
UntilNode.new(source, flags, keyword_loc, closing_loc, predicate, statements, location)
end
Create a new UntilNode
node
WhenNode(keyword_loc, conditions, then_keyword_loc, statements, source = nil, location = Location())
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 781
def WhenNode(keyword_loc, conditions, then_keyword_loc, statements, source = nil, location = Location())
WhenNode.new(source, keyword_loc, conditions, then_keyword_loc, statements, location)
end
Create a new WhenNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 786
def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, source = nil, location = Location())
WhileNode.new(source, flags, keyword_loc, closing_loc, predicate, statements, location)
end
Create a new WhileNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 791
def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, source = nil, location = Location())
XStringNode.new(source, flags, opening_loc, content_loc, closing_loc, unescaped, location)
end
Create a new XStringNode
node
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/dsl.rb, line 796
def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, source = nil, location = Location())
YieldNode.new(source, keyword_loc, lparen_loc, arguments, rparen_loc, location)
end
Create a new YieldNode
node