модуль Prism::DSL
Модуль DSL предоставляет набор методов, которые могут быть использованы для создания узлов призмы более кратким способом. Например, вместо:
source = Prism::Source.new("[1]")
Prism::ArrayNode.new(
[
Prism::IntegerNode.new(
Prism::IntegerBaseFlags::DECIMAL,
Prism::Location.new(source, 1, 1),
)
],
Prism::Location.new(source, 0, 1),
Prism::Location.new(source, 2, 1)
)
можно написать:
source = Prism::Source.new("[1]")
ArrayNode(
IntegerNode(Prism::IntegerBaseFlags::DECIMAL, Location(source, 1, 1))),
Location(source, 0, 1),
Location(source, 2, 1)
) Это преимущественно полезно в контексте написания тестов, но также может быть использовано для программированного генерирования деревьев.
Приватные методы экземпляра
# File lib/prism/dsl.rb, line 46 def AliasGlobalVariableNode(new_name, old_name, keyword_loc, location = Location()) AliasGlobalVariableNode.new(new_name, old_name, keyword_loc, location) end
Создать новый узел AliasGlobalVariableNode
# File lib/prism/dsl.rb, line 51 def AliasMethodNode(new_name, old_name, keyword_loc, location = Location()) AliasMethodNode.new(new_name, old_name, keyword_loc, location) end
Создать новый узел AliasMethodNode
# File lib/prism/dsl.rb, line 56 def AlternationPatternNode(left, right, operator_loc, location = Location()) AlternationPatternNode.new(left, right, operator_loc, location) end
Создать новый узел AlternationPatternNode
# File lib/prism/dsl.rb, line 61 def AndNode(left, right, operator_loc, location = Location()) AndNode.new(left, right, operator_loc, location) end
Создать новый узел AndNode
# File lib/prism/dsl.rb, line 66 def ArgumentsNode(flags, arguments, location = Location()) ArgumentsNode.new(flags, arguments, location) end
Создать новый узел ArgumentsNode
# File lib/prism/dsl.rb, line 71 def ArrayNode(flags, elements, opening_loc, closing_loc, location = Location()) ArrayNode.new(flags, elements, opening_loc, closing_loc, location) end
Создать новый узел ArrayNode
# File lib/prism/dsl.rb, line 76 def ArrayPatternNode(constant, requireds, rest, posts, opening_loc, closing_loc, location = Location()) ArrayPatternNode.new(constant, requireds, rest, posts, opening_loc, closing_loc, location) end
Создать новый узел ArrayPatternNode
# File lib/prism/dsl.rb, line 81 def AssocNode(key, value, operator_loc, location = Location()) AssocNode.new(key, value, operator_loc, location) end
Создать новый узел AssocNode
# File lib/prism/dsl.rb, line 86 def AssocSplatNode(value, operator_loc, location = Location()) AssocSplatNode.new(value, operator_loc, location) end
Создать новый узел AssocSplatNode
# File lib/prism/dsl.rb, line 91 def BackReferenceReadNode(name, location = Location()) BackReferenceReadNode.new(name, location) end
Создать новый узел BackReferenceReadNode
# File lib/prism/dsl.rb, line 96 def BeginNode(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location = Location()) BeginNode.new(begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc, location) end
Создать новый узел BeginNode
# File lib/prism/dsl.rb, line 101 def BlockArgumentNode(expression, operator_loc, location = Location()) BlockArgumentNode.new(expression, operator_loc, location) end
Создать новый узел BlockArgumentNode
# File lib/prism/dsl.rb, line 106 def BlockLocalVariableNode(name, location = Location()) BlockLocalVariableNode.new(name, location) end
Создать новый узел BlockLocalVariableNode
# File lib/prism/dsl.rb, line 111 def BlockNode(locals, locals_body_index, parameters, body, opening_loc, closing_loc, location = Location()) BlockNode.new(locals, locals_body_index, parameters, body, opening_loc, closing_loc, location) end
Создать новый узел BlockNode
# File lib/prism/dsl.rb, line 116 def BlockParameterNode(name, name_loc, operator_loc, location = Location()) BlockParameterNode.new(name, name_loc, operator_loc, location) end
Создать новый узел BlockParameterNode
# File lib/prism/dsl.rb, line 121 def BlockParametersNode(parameters, locals, opening_loc, closing_loc, location = Location()) BlockParametersNode.new(parameters, locals, opening_loc, closing_loc, location) end
Создать новый узел BlockParametersNode
# File lib/prism/dsl.rb, line 126 def BreakNode(arguments, keyword_loc, location = Location()) BreakNode.new(arguments, keyword_loc, location) end
Создать новый узел BreakNode
# File lib/prism/dsl.rb, line 131 def CallAndWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location = Location()) CallAndWriteNode.new(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location) end
Создать новый узел CallAndWriteNode
# File lib/prism/dsl.rb, line 136 def CallNode(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location = Location()) CallNode.new(flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block, location) end
Создать новый узел CallNode
# File lib/prism/dsl.rb, line 141 def CallOperatorWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location = Location()) CallOperatorWriteNode.new(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator, operator_loc, value, location) end
Создать новый узел CallOperatorWriteNode
# File lib/prism/dsl.rb, line 146 def CallOrWriteNode(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location = Location()) CallOrWriteNode.new(flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value, location) end
Создать новый узел CallOrWriteNode
# File lib/prism/dsl.rb, line 151 def CallTargetNode(flags, receiver, call_operator_loc, name, message_loc, location = Location()) CallTargetNode.new(flags, receiver, call_operator_loc, name, message_loc, location) end
Создать новый узел CallTargetNode
# File lib/prism/dsl.rb, line 156 def CapturePatternNode(value, target, operator_loc, location = Location()) CapturePatternNode.new(value, target, operator_loc, location) end
Создать новый узел CapturePatternNode
# File lib/prism/dsl.rb, line 161 def CaseMatchNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location = Location()) CaseMatchNode.new(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location) end
Создать новый узел CaseMatchNode
# File lib/prism/dsl.rb, line 166 def CaseNode(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location = Location()) CaseNode.new(predicate, conditions, consequent, case_keyword_loc, end_keyword_loc, location) end
Создать новый узел CaseNode
# File lib/prism/dsl.rb, line 171 def ClassNode(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location = Location()) ClassNode.new(locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name, location) end
Создать новый узел ClassNode
# File lib/prism/dsl.rb, line 176 def ClassVariableAndWriteNode(name, name_loc, operator_loc, value, location = Location()) ClassVariableAndWriteNode.new(name, name_loc, operator_loc, value, location) end
Создать новый узел ClassVariableAndWriteNode
# File lib/prism/dsl.rb, line 181 def ClassVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location()) ClassVariableOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location) end
Создать новый узел ClassVariableOperatorWriteNode
# File lib/prism/dsl.rb, line 186 def ClassVariableOrWriteNode(name, name_loc, operator_loc, value, location = Location()) ClassVariableOrWriteNode.new(name, name_loc, operator_loc, value, location) end
Создать новый узел ClassVariableOrWriteNode
# File lib/prism/dsl.rb, line 191 def ClassVariableReadNode(name, location = Location()) ClassVariableReadNode.new(name, location) end
Создать новый узел ClassVariableReadNode
# File lib/prism/dsl.rb, line 196 def ClassVariableTargetNode(name, location = Location()) ClassVariableTargetNode.new(name, location) end
Создать новый узел ClassVariableTargetNode
# File lib/prism/dsl.rb, line 201 def ClassVariableWriteNode(name, name_loc, value, operator_loc, location = Location()) ClassVariableWriteNode.new(name, name_loc, value, operator_loc, location) end
Создать новый узел ClassVariableWriteNode
# File lib/prism/dsl.rb, line 206 def ConstantAndWriteNode(name, name_loc, operator_loc, value, location = Location()) ConstantAndWriteNode.new(name, name_loc, operator_loc, value, location) end
Создать новый узел ConstantAndWriteNode
# File lib/prism/dsl.rb, line 211 def ConstantOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location()) ConstantOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location) end
Создать новый узел ConstantOperatorWriteNode
# File lib/prism/dsl.rb, line 216 def ConstantOrWriteNode(name, name_loc, operator_loc, value, location = Location()) ConstantOrWriteNode.new(name, name_loc, operator_loc, value, location) end
Создать новый узел ConstantOrWriteNode
# File lib/prism/dsl.rb, line 221 def ConstantPathAndWriteNode(target, operator_loc, value, location = Location()) ConstantPathAndWriteNode.new(target, operator_loc, value, location) end
Создать новый узел ConstantPathAndWriteNode
# File lib/prism/dsl.rb, line 226 def ConstantPathNode(parent, child, delimiter_loc, location = Location()) ConstantPathNode.new(parent, child, delimiter_loc, location) end
Создать новый узел ConstantPathNode
# File lib/prism/dsl.rb, line 231 def ConstantPathOperatorWriteNode(target, operator_loc, value, operator, location = Location()) ConstantPathOperatorWriteNode.new(target, operator_loc, value, operator, location) end
Создать новый узел ConstantPathOperatorWriteNode
# File lib/prism/dsl.rb, line 236 def ConstantPathOrWriteNode(target, operator_loc, value, location = Location()) ConstantPathOrWriteNode.new(target, operator_loc, value, location) end
Создать новый узел ConstantPathOrWriteNode
# File lib/prism/dsl.rb, line 241 def ConstantPathTargetNode(parent, child, delimiter_loc, location = Location()) ConstantPathTargetNode.new(parent, child, delimiter_loc, location) end
Создать новый узел ConstantPathTargetNode
# File lib/prism/dsl.rb, line 246 def ConstantPathWriteNode(target, operator_loc, value, location = Location()) ConstantPathWriteNode.new(target, operator_loc, value, location) end
Создать новый узел ConstantPathWriteNode
# File lib/prism/dsl.rb, line 251 def ConstantReadNode(name, location = Location()) ConstantReadNode.new(name, location) end
Создать новый узел ConstantReadNode
# File lib/prism/dsl.rb, line 256 def ConstantTargetNode(name, location = Location()) ConstantTargetNode.new(name, location) end
Создать новый узел ConstantTargetNode
# File lib/prism/dsl.rb, line 261 def ConstantWriteNode(name, name_loc, value, operator_loc, location = Location()) ConstantWriteNode.new(name, name_loc, value, operator_loc, location) end
Создать новый узел ConstantWriteNode
# File lib/prism/dsl.rb, line 266 def DefNode(name, name_loc, receiver, parameters, body, locals, locals_body_index, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location = Location()) DefNode.new(name, name_loc, receiver, parameters, body, locals, locals_body_index, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc, location) end
Создать новый узел DefNode
# File lib/prism/dsl.rb, line 271 def DefinedNode(lparen_loc, value, rparen_loc, keyword_loc, location = Location()) DefinedNode.new(lparen_loc, value, rparen_loc, keyword_loc, location) end
Создать новый узел DefinedNode
# File lib/prism/dsl.rb, line 276 def ElseNode(else_keyword_loc, statements, end_keyword_loc, location = Location()) ElseNode.new(else_keyword_loc, statements, end_keyword_loc, location) end
Создать новый узел ElseNode
# File lib/prism/dsl.rb, line 281 def EmbeddedStatementsNode(opening_loc, statements, closing_loc, location = Location()) EmbeddedStatementsNode.new(opening_loc, statements, closing_loc, location) end
Создать новый узел EmbeddedStatementsNode
# File lib/prism/dsl.rb, line 286 def EmbeddedVariableNode(operator_loc, variable, location = Location()) EmbeddedVariableNode.new(operator_loc, variable, location) end
Создать новый узел EmbeddedVariableNode
# File lib/prism/dsl.rb, line 291 def EnsureNode(ensure_keyword_loc, statements, end_keyword_loc, location = Location()) EnsureNode.new(ensure_keyword_loc, statements, end_keyword_loc, location) end
Создать новый узел EnsureNode
# File lib/prism/dsl.rb, line 296 def FalseNode(location = Location()) FalseNode.new(location) end
Создать новый узел FalseNode
# File lib/prism/dsl.rb, line 301 def FindPatternNode(constant, left, requireds, right, opening_loc, closing_loc, location = Location()) FindPatternNode.new(constant, left, requireds, right, opening_loc, closing_loc, location) end
Создать новый узел FindPatternNode
# File lib/prism/dsl.rb, line 306 def FlipFlopNode(flags, left, right, operator_loc, location = Location()) FlipFlopNode.new(flags, left, right, operator_loc, location) end
Создать новый узел FlipFlopNode
# File lib/prism/dsl.rb, line 311 def FloatNode(location = Location()) FloatNode.new(location) end
Создать новый узел FloatNode
# File lib/prism/dsl.rb, line 316 def ForNode(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location = Location()) ForNode.new(index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc, location) end
Создать новый узел ForNode
# File lib/prism/dsl.rb, line 321 def ForwardingArgumentsNode(location = Location()) ForwardingArgumentsNode.new(location) end
Создать новый узел ForwardingArgumentsNode
# File lib/prism/dsl.rb, line 326 def ForwardingParameterNode(location = Location()) ForwardingParameterNode.new(location) end
Создать новый узел ForwardingParameterNode
# File lib/prism/dsl.rb, line 331 def ForwardingSuperNode(block, location = Location()) ForwardingSuperNode.new(block, location) end
Создать новый узел ForwardingSuperNode
# File lib/prism/dsl.rb, line 336 def GlobalVariableAndWriteNode(name, name_loc, operator_loc, value, location = Location()) GlobalVariableAndWriteNode.new(name, name_loc, operator_loc, value, location) end
Создать новый узел GlobalVariableAndWriteNode
# File lib/prism/dsl.rb, line 341 def GlobalVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location()) GlobalVariableOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location) end
Создать новый узел GlobalVariableOperatorWriteNode
# File lib/prism/dsl.rb, line 346 def GlobalVariableOrWriteNode(name, name_loc, operator_loc, value, location = Location()) GlobalVariableOrWriteNode.new(name, name_loc, operator_loc, value, location) end
Создать новый узел GlobalVariableOrWriteNode
# File lib/prism/dsl.rb, line 351 def GlobalVariableReadNode(name, location = Location()) GlobalVariableReadNode.new(name, location) end
Создать новый узел GlobalVariableReadNode
# File lib/prism/dsl.rb, line 356 def GlobalVariableTargetNode(name, location = Location()) GlobalVariableTargetNode.new(name, location) end
Создать новый узел GlobalVariableTargetNode
# File lib/prism/dsl.rb, line 361 def GlobalVariableWriteNode(name, name_loc, value, operator_loc, location = Location()) GlobalVariableWriteNode.new(name, name_loc, value, operator_loc, location) end
Создать новый узел GlobalVariableWriteNode
# File lib/prism/dsl.rb, line 366 def HashNode(opening_loc, elements, closing_loc, location = Location()) HashNode.new(opening_loc, elements, closing_loc, location) end
Создать новый узел HashNode
# File lib/prism/dsl.rb, line 371 def HashPatternNode(constant, elements, rest, opening_loc, closing_loc, location = Location()) HashPatternNode.new(constant, elements, rest, opening_loc, closing_loc, location) end
Создать новый узел HashPatternNode
# File lib/prism/dsl.rb, line 376 def IfNode(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location = Location()) IfNode.new(if_keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location) end
Создать новый узел IfNode
# File lib/prism/dsl.rb, line 381 def ImaginaryNode(numeric, location = Location()) ImaginaryNode.new(numeric, location) end
Создать новый узел ImaginaryNode
# File lib/prism/dsl.rb, line 386 def ImplicitNode(value, location = Location()) ImplicitNode.new(value, location) end
Создать новый узел ImplicitNode
# File lib/prism/dsl.rb, line 391 def ImplicitRestNode(location = Location()) ImplicitRestNode.new(location) end
Создать новый узел ImplicitRestNode
# File lib/prism/dsl.rb, line 396 def InNode(pattern, statements, in_loc, then_loc, location = Location()) InNode.new(pattern, statements, in_loc, then_loc, location) end
Создать новый узел InNode
# File lib/prism/dsl.rb, line 401 def IndexAndWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location = Location()) IndexAndWriteNode.new(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location) end
Создать новый узел IndexAndWriteNode
# File lib/prism/dsl.rb, line 406 def IndexOperatorWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location = Location()) IndexOperatorWriteNode.new(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator, operator_loc, value, location) end
Создать новый узел IndexOperatorWriteNode
# File lib/prism/dsl.rb, line 411 def IndexOrWriteNode(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location = Location()) IndexOrWriteNode.new(flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value, location) end
Создать новый узел IndexOrWriteNode
# File lib/prism/dsl.rb, line 416 def IndexTargetNode(flags, receiver, opening_loc, arguments, closing_loc, block, location = Location()) IndexTargetNode.new(flags, receiver, opening_loc, arguments, closing_loc, block, location) end
Создать новый узел IndexTargetNode
# File lib/prism/dsl.rb, line 421 def InstanceVariableAndWriteNode(name, name_loc, operator_loc, value, location = Location()) InstanceVariableAndWriteNode.new(name, name_loc, operator_loc, value, location) end
Создать новый узел InstanceVariableAndWriteNode
# File lib/prism/dsl.rb, line 426 def InstanceVariableOperatorWriteNode(name, name_loc, operator_loc, value, operator, location = Location()) InstanceVariableOperatorWriteNode.new(name, name_loc, operator_loc, value, operator, location) end
Создать новый узел InstanceVariableOperatorWriteNode
# File lib/prism/dsl.rb, line 431 def InstanceVariableOrWriteNode(name, name_loc, operator_loc, value, location = Location()) InstanceVariableOrWriteNode.new(name, name_loc, operator_loc, value, location) end
Создать новый узел InstanceVariableOrWriteNode
# File lib/prism/dsl.rb, line 436 def InstanceVariableReadNode(name, location = Location()) InstanceVariableReadNode.new(name, location) end
Создать новый узел InstanceVariableReadNode
# File lib/prism/dsl.rb, line 441 def InstanceVariableTargetNode(name, location = Location()) InstanceVariableTargetNode.new(name, location) end
Создать новый узел InstanceVariableTargetNode
# File lib/prism/dsl.rb, line 446 def InstanceVariableWriteNode(name, name_loc, value, operator_loc, location = Location()) InstanceVariableWriteNode.new(name, name_loc, value, operator_loc, location) end
Создать новый узел InstanceVariableWriteNode
# File lib/prism/dsl.rb, line 451 def IntegerNode(flags, location = Location()) IntegerNode.new(flags, location) end
Создать новый узел IntegerNode
# File lib/prism/dsl.rb, line 456 def InterpolatedMatchLastLineNode(flags, opening_loc, parts, closing_loc, location = Location()) InterpolatedMatchLastLineNode.new(flags, opening_loc, parts, closing_loc, location) end
Создать новый узел InterpolatedMatchLastLineNode
# File lib/prism/dsl.rb, line 461 def InterpolatedRegularExpressionNode(flags, opening_loc, parts, closing_loc, location = Location()) InterpolatedRegularExpressionNode.new(flags, opening_loc, parts, closing_loc, location) end
Создать новый узел InterpolatedRegularExpressionNode
# File lib/prism/dsl.rb, line 466 def InterpolatedStringNode(opening_loc, parts, closing_loc, location = Location()) InterpolatedStringNode.new(opening_loc, parts, closing_loc, location) end
Создать новый узел InterpolatedStringNode
# File lib/prism/dsl.rb, line 471 def InterpolatedSymbolNode(opening_loc, parts, closing_loc, location = Location()) InterpolatedSymbolNode.new(opening_loc, parts, closing_loc, location) end
Создать новый узел InterpolatedSymbolNode
# File lib/prism/dsl.rb, line 476 def InterpolatedXStringNode(opening_loc, parts, closing_loc, location = Location()) InterpolatedXStringNode.new(opening_loc, parts, closing_loc, location) end
Создать новый узел InterpolatedXStringNode
# File lib/prism/dsl.rb, line 481 def KeywordHashNode(flags, elements, location = Location()) KeywordHashNode.new(flags, elements, location) end
Создать новый узел KeywordHashNode
# File lib/prism/dsl.rb, line 486 def KeywordRestParameterNode(name, name_loc, operator_loc, location = Location()) KeywordRestParameterNode.new(name, name_loc, operator_loc, location) end
Создать новый узел KeywordRestParameterNode
# File lib/prism/dsl.rb, line 491 def LambdaNode(locals, locals_body_index, operator_loc, opening_loc, closing_loc, parameters, body, location = Location()) LambdaNode.new(locals, locals_body_index, operator_loc, opening_loc, closing_loc, parameters, body, location) end
Создать новый узел LambdaNode
# File lib/prism/dsl.rb, line 496 def LocalVariableAndWriteNode(name_loc, operator_loc, value, name, depth, location = Location()) LocalVariableAndWriteNode.new(name_loc, operator_loc, value, name, depth, location) end
Создать новый узел LocalVariableAndWriteNode
# File lib/prism/dsl.rb, line 501 def LocalVariableOperatorWriteNode(name_loc, operator_loc, value, name, operator, depth, location = Location()) LocalVariableOperatorWriteNode.new(name_loc, operator_loc, value, name, operator, depth, location) end
Создать новый узел LocalVariableOperatorWriteNode
# File lib/prism/dsl.rb, line 506 def LocalVariableOrWriteNode(name_loc, operator_loc, value, name, depth, location = Location()) LocalVariableOrWriteNode.new(name_loc, operator_loc, value, name, depth, location) end
Создать новый узел LocalVariableOrWriteNode
# File lib/prism/dsl.rb, line 511 def LocalVariableReadNode(name, depth, location = Location()) LocalVariableReadNode.new(name, depth, location) end
Создать новый узел LocalVariableReadNode
# File lib/prism/dsl.rb, line 516 def LocalVariableTargetNode(name, depth, location = Location()) LocalVariableTargetNode.new(name, depth, location) end
Создать новый узел LocalVariableTargetNode
# File lib/prism/dsl.rb, line 521 def LocalVariableWriteNode(name, depth, name_loc, value, operator_loc, location = Location()) LocalVariableWriteNode.new(name, depth, name_loc, value, operator_loc, location) end
Создать новый узел LocalVariableWriteNode
# File lib/prism/dsl.rb, line 41 def Location(source = nil, start_offset = 0, length = 0) Location.new(source, start_offset, length) end
Создать новый объект Location
# File lib/prism/dsl.rb, line 526 def MatchLastLineNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = Location()) MatchLastLineNode.new(flags, opening_loc, content_loc, closing_loc, unescaped, location) end
Создать новый узел MatchLastLineNode
# File lib/prism/dsl.rb, line 531 def MatchPredicateNode(value, pattern, operator_loc, location = Location()) MatchPredicateNode.new(value, pattern, operator_loc, location) end
Создать новый узел MatchPredicateNode
# File lib/prism/dsl.rb, line 536 def MatchRequiredNode(value, pattern, operator_loc, location = Location()) MatchRequiredNode.new(value, pattern, operator_loc, location) end
Создать новый узел MatchRequiredNode
# File lib/prism/dsl.rb, line 541 def MatchWriteNode(call, targets, location = Location()) MatchWriteNode.new(call, targets, location) end
Создать новый узел MatchWriteNode
# File lib/prism/dsl.rb, line 546 def MissingNode(location = Location()) MissingNode.new(location) end
Создать новый узел MissingNode
# File lib/prism/dsl.rb, line 551 def ModuleNode(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location = Location()) ModuleNode.new(locals, module_keyword_loc, constant_path, body, end_keyword_loc, name, location) end
Создать новый узел ModuleNode
# File lib/prism/dsl.rb, line 556 def MultiTargetNode(lefts, rest, rights, lparen_loc, rparen_loc, location = Location()) MultiTargetNode.new(lefts, rest, rights, lparen_loc, rparen_loc, location) end
Создать новый узел MultiTargetNode
# File lib/prism/dsl.rb, line 561 def MultiWriteNode(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location = Location()) MultiWriteNode.new(lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value, location) end
Создать новый узел MultiWriteNode
# File lib/prism/dsl.rb, line 566 def NextNode(arguments, keyword_loc, location = Location()) NextNode.new(arguments, keyword_loc, location) end
Создать новый узел NextNode
# File lib/prism/dsl.rb, line 571 def NilNode(location = Location()) NilNode.new(location) end
Создать новый узел NilNode
# File lib/prism/dsl.rb, line 576 def NoKeywordsParameterNode(operator_loc, keyword_loc, location = Location()) NoKeywordsParameterNode.new(operator_loc, keyword_loc, location) end
Создать новый узел NoKeywordsParameterNode
# File lib/prism/dsl.rb, line 581 def NumberedParametersNode(maximum, location = Location()) NumberedParametersNode.new(maximum, location) end
Создать новый узел NumberedParametersNode
# File lib/prism/dsl.rb, line 586 def NumberedReferenceReadNode(number, location = Location()) NumberedReferenceReadNode.new(number, location) end
Создать новый узел NumberedReferenceReadNode
# File lib/prism/dsl.rb, line 591 def OptionalKeywordParameterNode(name, name_loc, value, location = Location()) OptionalKeywordParameterNode.new(name, name_loc, value, location) end
Создать новый узел OptionalKeywordParameterNode
# File lib/prism/dsl.rb, line 596 def OptionalParameterNode(name, name_loc, operator_loc, value, location = Location()) OptionalParameterNode.new(name, name_loc, operator_loc, value, location) end
Создать новый узел OptionalParameterNode
# File lib/prism/dsl.rb, line 601 def OrNode(left, right, operator_loc, location = Location()) OrNode.new(left, right, operator_loc, location) end
Создать новый узел OrNode
# File lib/prism/dsl.rb, line 606 def ParametersNode(requireds, optionals, rest, posts, keywords, keyword_rest, block, location = Location()) ParametersNode.new(requireds, optionals, rest, posts, keywords, keyword_rest, block, location) end
Создать новый узел ParametersNode
# File lib/prism/dsl.rb, line 611 def ParenthesesNode(body, opening_loc, closing_loc, location = Location()) ParenthesesNode.new(body, opening_loc, closing_loc, location) end
Создать новый узел ParenthesesNode
# File lib/prism/dsl.rb, line 616 def PinnedExpressionNode(expression, operator_loc, lparen_loc, rparen_loc, location = Location()) PinnedExpressionNode.new(expression, operator_loc, lparen_loc, rparen_loc, location) end
Создать новый узел PinnedExpressionNode
# File lib/prism/dsl.rb, line 621 def PinnedVariableNode(variable, operator_loc, location = Location()) PinnedVariableNode.new(variable, operator_loc, location) end
Создать новый узел PinnedVariableNode
# File lib/prism/dsl.rb, line 626 def PostExecutionNode(statements, keyword_loc, opening_loc, closing_loc, location = Location()) PostExecutionNode.new(statements, keyword_loc, opening_loc, closing_loc, location) end
Создать новый узел PostExecutionNode
# File lib/prism/dsl.rb, line 631 def PreExecutionNode(statements, keyword_loc, opening_loc, closing_loc, location = Location()) PreExecutionNode.new(statements, keyword_loc, opening_loc, closing_loc, location) end
Создать новый узел PreExecutionNode
# File lib/prism/dsl.rb, line 636 def ProgramNode(locals, statements, location = Location()) ProgramNode.new(locals, statements, location) end
Создать новый узел ProgramNode
# File lib/prism/dsl.rb, line 641 def RangeNode(flags, left, right, operator_loc, location = Location()) RangeNode.new(flags, left, right, operator_loc, location) end
Создать новый узел RangeNode
# File lib/prism/dsl.rb, line 646 def RationalNode(numeric, location = Location()) RationalNode.new(numeric, location) end
Создать новый узел RationalNode
# File lib/prism/dsl.rb, line 651 def RedoNode(location = Location()) RedoNode.new(location) end
Создать новый узел RedoNode
# File lib/prism/dsl.rb, line 656 def RegularExpressionNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = Location()) RegularExpressionNode.new(flags, opening_loc, content_loc, closing_loc, unescaped, location) end
Создать новый узел RegularExpressionNode
# File lib/prism/dsl.rb, line 661 def RequiredKeywordParameterNode(name, name_loc, location = Location()) RequiredKeywordParameterNode.new(name, name_loc, location) end
Создать новый узел RequiredKeywordParameterNode
# File lib/prism/dsl.rb, line 666 def RequiredParameterNode(name, location = Location()) RequiredParameterNode.new(name, location) end
Создать новый узел RequiredParameterNode
# File lib/prism/dsl.rb, line 671 def RescueModifierNode(expression, keyword_loc, rescue_expression, location = Location()) RescueModifierNode.new(expression, keyword_loc, rescue_expression, location) end
Создать новый узел RescueModifierNode
# File lib/prism/dsl.rb, line 676 def RescueNode(keyword_loc, exceptions, operator_loc, reference, statements, consequent, location = Location()) RescueNode.new(keyword_loc, exceptions, operator_loc, reference, statements, consequent, location) end
Создать новый узел RescueNode
# File lib/prism/dsl.rb, line 681 def RestParameterNode(name, name_loc, operator_loc, location = Location()) RestParameterNode.new(name, name_loc, operator_loc, location) end
Создать новый узел RestParameterNode
# File lib/prism/dsl.rb, line 686 def RetryNode(location = Location()) RetryNode.new(location) end
Создать новый узел RetryNode
# File lib/prism/dsl.rb, line 691 def ReturnNode(keyword_loc, arguments, location = Location()) ReturnNode.new(keyword_loc, arguments, location) end
Создать новый узел ReturnNode
# File lib/prism/dsl.rb, line 696 def SelfNode(location = Location()) SelfNode.new(location) end
Создать новый узел SelfNode
# File lib/prism/dsl.rb, line 701 def SingletonClassNode(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location = Location()) SingletonClassNode.new(locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc, location) end
Создать новый узел SingletonClassNode
# File lib/prism/dsl.rb, line 706 def SourceEncodingNode(location = Location()) SourceEncodingNode.new(location) end
Создать новый узел SourceEncodingNode
# File lib/prism/dsl.rb, line 711 def SourceFileNode(filepath, location = Location()) SourceFileNode.new(filepath, location) end
Создать новый узел SourceFileNode
# File lib/prism/dsl.rb, line 716 def SourceLineNode(location = Location()) SourceLineNode.new(location) end
Создать новый узел SourceLineNode
# File lib/prism/dsl.rb, line 721 def SplatNode(operator_loc, expression, location = Location()) SplatNode.new(operator_loc, expression, location) end
Создать новый узел SplatNode
# File lib/prism/dsl.rb, line 726 def StatementsNode(body, location = Location()) StatementsNode.new(body, location) end
Создать новый узел StatementsNode
# File lib/prism/dsl.rb, line 731 def StringNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = Location()) StringNode.new(flags, opening_loc, content_loc, closing_loc, unescaped, location) end
Создать новый узел StringNode
# File lib/prism/dsl.rb, line 736 def SuperNode(keyword_loc, lparen_loc, arguments, rparen_loc, block, location = Location()) SuperNode.new(keyword_loc, lparen_loc, arguments, rparen_loc, block, location) end
Создать новый узел SuperNode
# File lib/prism/dsl.rb, line 741 def SymbolNode(flags, opening_loc, value_loc, closing_loc, unescaped, location = Location()) SymbolNode.new(flags, opening_loc, value_loc, closing_loc, unescaped, location) end
Создать новый узел SymbolNode
# File lib/prism/dsl.rb, line 746 def TrueNode(location = Location()) TrueNode.new(location) end
Создать новый узел TrueNode
# File lib/prism/dsl.rb, line 751 def UndefNode(names, keyword_loc, location = Location()) UndefNode.new(names, keyword_loc, location) end
Создать новый узел UndefNode
# File lib/prism/dsl.rb, line 756 def UnlessNode(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location = Location()) UnlessNode.new(keyword_loc, predicate, then_keyword_loc, statements, consequent, end_keyword_loc, location) end
Создать новый узел UnlessNode
# File lib/prism/dsl.rb, line 761 def UntilNode(flags, keyword_loc, closing_loc, predicate, statements, location = Location()) UntilNode.new(flags, keyword_loc, closing_loc, predicate, statements, location) end
Создать новый узел UntilNode
# File lib/prism/dsl.rb, line 766 def WhenNode(keyword_loc, conditions, statements, location = Location()) WhenNode.new(keyword_loc, conditions, statements, location) end
Создать новый узел WhenNode
# File lib/prism/dsl.rb, line 771 def WhileNode(flags, keyword_loc, closing_loc, predicate, statements, location = Location()) WhileNode.new(flags, keyword_loc, closing_loc, predicate, statements, location) end
Создать новый узел WhileNode
# File lib/prism/dsl.rb, line 776 def XStringNode(flags, opening_loc, content_loc, closing_loc, unescaped, location = Location()) XStringNode.new(flags, opening_loc, content_loc, closing_loc, unescaped, location) end
Создать новый узел XStringNode
# File lib/prism/dsl.rb, line 781 def YieldNode(keyword_loc, lparen_loc, arguments, rparen_loc, location = Location()) YieldNode.new(keyword_loc, lparen_loc, arguments, rparen_loc, location) end
Создать новый узел YieldNode
Ruby Core © 1993–2022 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.