1. Prism::
  2. DSL

module Prism::DSL

TheDSL 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(source,0,Prism::Location.new(source,0,3),0,  [Prism::IntegerNode.new(source,0,Prism::Location.new(source,1,1),Prism::IntegerBaseFlags::DECIMAL,1    )  ],Prism::Location.new(source,0,1),Prism::Location.new(source,2,1))

you could instead write:

classBuilderincludePrism::DSLattr_reader:default_sourcedefinitialize@default_source =source("[1]")enddefbuildarray_node(location:location(start_offset:0,length:3),elements: [integer_node(location:location(start_offset:1,length:1),flags:integer_base_flag(:decimal),value:1        )      ],opening_loc:location(start_offset:0,length:1),closing_loc:location(start_offset:2,length:1)    )endend

This is mostly helpful in the context of generating trees programmatically.

Public Instance Methods

Source
# File lib/prism/dsl.rb, line 80defalias_global_variable_node(source:default_source,node_id:0,location:default_location,flags:0,new_name:global_variable_read_node(source:source),old_name:global_variable_read_node(source:source),keyword_loc:location)AliasGlobalVariableNode.new(source,node_id,location,flags,new_name,old_name,keyword_loc)end

Create a newAliasGlobalVariableNode node.

Source
# File lib/prism/dsl.rb, line 85defalias_method_node(source:default_source,node_id:0,location:default_location,flags:0,new_name:symbol_node(source:source),old_name:symbol_node(source:source),keyword_loc:location)AliasMethodNode.new(source,node_id,location,flags,new_name,old_name,keyword_loc)end

Create a newAliasMethodNode node.

Source
# File lib/prism/dsl.rb, line 90defalternation_pattern_node(source:default_source,node_id:0,location:default_location,flags:0,left:default_node(source,location),right:default_node(source,location),operator_loc:location)AlternationPatternNode.new(source,node_id,location,flags,left,right,operator_loc)end

Create a newAlternationPatternNode node.

Source
# File lib/prism/dsl.rb, line 95defand_node(source:default_source,node_id:0,location:default_location,flags:0,left:default_node(source,location),right:default_node(source,location),operator_loc:location)AndNode.new(source,node_id,location,flags,left,right,operator_loc)end

Create a newAndNode node.

Source
# File lib/prism/dsl.rb, line 100defarguments_node(source:default_source,node_id:0,location:default_location,flags:0,arguments: [])ArgumentsNode.new(source,node_id,location,flags,arguments)end

Create a newArgumentsNode node.

Source
# File lib/prism/dsl.rb, line 835defarguments_node_flag(name)casenamewhen:contains_forwardingthenArgumentsNodeFlags::CONTAINS_FORWARDINGwhen:contains_keywordsthenArgumentsNodeFlags::CONTAINS_KEYWORDSwhen:contains_keyword_splatthenArgumentsNodeFlags::CONTAINS_KEYWORD_SPLATwhen:contains_splatthenArgumentsNodeFlags::CONTAINS_SPLATwhen:contains_multiple_splatsthenArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATSelseKernel.raiseArgumentError,"invalid ArgumentsNodeFlags flag: #{name.inspect}"endend

Retrieve the value of one of theArgumentsNodeFlags flags.

Source
# File lib/prism/dsl.rb, line 105defarray_node(source:default_source,node_id:0,location:default_location,flags:0,elements: [],opening_loc:nil,closing_loc:nil)ArrayNode.new(source,node_id,location,flags,elements,opening_loc,closing_loc)end

Create a newArrayNode node.

Source
# File lib/prism/dsl.rb, line 847defarray_node_flag(name)casenamewhen:contains_splatthenArrayNodeFlags::CONTAINS_SPLATelseKernel.raiseArgumentError,"invalid ArrayNodeFlags flag: #{name.inspect}"endend

Retrieve the value of one of theArrayNodeFlags flags.

Source
# File lib/prism/dsl.rb, line 110defarray_pattern_node(source:default_source,node_id:0,location:default_location,flags:0,constant:nil,requireds: [],rest:nil,posts: [],opening_loc:nil,closing_loc:nil)ArrayPatternNode.new(source,node_id,location,flags,constant,requireds,rest,posts,opening_loc,closing_loc)end

Create a newArrayPatternNode node.

Source
# File lib/prism/dsl.rb, line 115defassoc_node(source:default_source,node_id:0,location:default_location,flags:0,key:default_node(source,location),value:default_node(source,location),operator_loc:nil)AssocNode.new(source,node_id,location,flags,key,value,operator_loc)end

Create a newAssocNode node.

Source
# File lib/prism/dsl.rb, line 120defassoc_splat_node(source:default_source,node_id:0,location:default_location,flags:0,value:nil,operator_loc:location)AssocSplatNode.new(source,node_id,location,flags,value,operator_loc)end

Create a newAssocSplatNode node.

Source
# File lib/prism/dsl.rb, line 125defback_reference_read_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")BackReferenceReadNode.new(source,node_id,location,flags,name)end

Create a newBackReferenceReadNode node.

Source
# File lib/prism/dsl.rb, line 130defbegin_node(source:default_source,node_id:0,location:default_location,flags:0,begin_keyword_loc:nil,statements:nil,rescue_clause:nil,else_clause:nil,ensure_clause:nil,end_keyword_loc:nil)BeginNode.new(source,node_id,location,flags,begin_keyword_loc,statements,rescue_clause,else_clause,ensure_clause,end_keyword_loc)end

Create a newBeginNode node.

Source
# File lib/prism/dsl.rb, line 135defblock_argument_node(source:default_source,node_id:0,location:default_location,flags:0,expression:nil,operator_loc:location)BlockArgumentNode.new(source,node_id,location,flags,expression,operator_loc)end

Create a newBlockArgumentNode node.

Source
# File lib/prism/dsl.rb, line 140defblock_local_variable_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")BlockLocalVariableNode.new(source,node_id,location,flags,name)end

Create a newBlockLocalVariableNode node.

Source
# File lib/prism/dsl.rb, line 145defblock_node(source:default_source,node_id:0,location:default_location,flags:0,locals: [],parameters:nil,body:nil,opening_loc:location,closing_loc:location)BlockNode.new(source,node_id,location,flags,locals,parameters,body,opening_loc,closing_loc)end

Create a newBlockNode node.

Source
# File lib/prism/dsl.rb, line 150defblock_parameter_node(source:default_source,node_id:0,location:default_location,flags:0,name:nil,name_loc:nil,operator_loc:location)BlockParameterNode.new(source,node_id,location,flags,name,name_loc,operator_loc)end

Create a newBlockParameterNode node.

Source
# File lib/prism/dsl.rb, line 155defblock_parameters_node(source:default_source,node_id:0,location:default_location,flags:0,parameters:nil,locals: [],opening_loc:nil,closing_loc:nil)BlockParametersNode.new(source,node_id,location,flags,parameters,locals,opening_loc,closing_loc)end

Create a newBlockParametersNode node.

Source
# File lib/prism/dsl.rb, line 160defbreak_node(source:default_source,node_id:0,location:default_location,flags:0,arguments:nil,keyword_loc:location)BreakNode.new(source,node_id,location,flags,arguments,keyword_loc)end

Create a newBreakNode node.

Source
# File lib/prism/dsl.rb, line 165defcall_and_write_node(source:default_source,node_id:0,location:default_location,flags:0,receiver:nil,call_operator_loc:nil,message_loc:nil,read_name::"",write_name::"",operator_loc:location,value:default_node(source,location))CallAndWriteNode.new(source,node_id,location,flags,receiver,call_operator_loc,message_loc,read_name,write_name,operator_loc,value)end

Create a newCallAndWriteNode node.

Source
# File lib/prism/dsl.rb, line 170defcall_node(source:default_source,node_id:0,location:default_location,flags:0,receiver:nil,call_operator_loc:nil,name::"",message_loc:nil,opening_loc:nil,arguments:nil,closing_loc:nil,equal_loc:nil,block:nil)CallNode.new(source,node_id,location,flags,receiver,call_operator_loc,name,message_loc,opening_loc,arguments,closing_loc,equal_loc,block)end

Create a newCallNode node.

Source
# File lib/prism/dsl.rb, line 855defcall_node_flag(name)casenamewhen:safe_navigationthenCallNodeFlags::SAFE_NAVIGATIONwhen:variable_callthenCallNodeFlags::VARIABLE_CALLwhen:attribute_writethenCallNodeFlags::ATTRIBUTE_WRITEwhen:ignore_visibilitythenCallNodeFlags::IGNORE_VISIBILITYelseKernel.raiseArgumentError,"invalid CallNodeFlags flag: #{name.inspect}"endend

Retrieve the value of one of theCallNodeFlags flags.

Source
# File lib/prism/dsl.rb, line 175defcall_operator_write_node(source:default_source,node_id:0,location:default_location,flags:0,receiver:nil,call_operator_loc:nil,message_loc:nil,read_name::"",write_name::"",binary_operator::"",binary_operator_loc:location,value:default_node(source,location))CallOperatorWriteNode.new(source,node_id,location,flags,receiver,call_operator_loc,message_loc,read_name,write_name,binary_operator,binary_operator_loc,value)end

Create a newCallOperatorWriteNode node.

Source
# File lib/prism/dsl.rb, line 180defcall_or_write_node(source:default_source,node_id:0,location:default_location,flags:0,receiver:nil,call_operator_loc:nil,message_loc:nil,read_name::"",write_name::"",operator_loc:location,value:default_node(source,location))CallOrWriteNode.new(source,node_id,location,flags,receiver,call_operator_loc,message_loc,read_name,write_name,operator_loc,value)end

Create a newCallOrWriteNode node.

Source
# File lib/prism/dsl.rb, line 185defcall_target_node(source:default_source,node_id:0,location:default_location,flags:0,receiver:default_node(source,location),call_operator_loc:location,name::"",message_loc:location)CallTargetNode.new(source,node_id,location,flags,receiver,call_operator_loc,name,message_loc)end

Create a newCallTargetNode node.

Source
# File lib/prism/dsl.rb, line 190defcapture_pattern_node(source:default_source,node_id:0,location:default_location,flags:0,value:default_node(source,location),target:local_variable_target_node(source:source),operator_loc:location)CapturePatternNode.new(source,node_id,location,flags,value,target,operator_loc)end

Create a newCapturePatternNode node.

Source
# File lib/prism/dsl.rb, line 195defcase_match_node(source:default_source,node_id:0,location:default_location,flags:0,predicate:nil,conditions: [],else_clause:nil,case_keyword_loc:location,end_keyword_loc:location)CaseMatchNode.new(source,node_id,location,flags,predicate,conditions,else_clause,case_keyword_loc,end_keyword_loc)end

Create a newCaseMatchNode node.

Source
# File lib/prism/dsl.rb, line 200defcase_node(source:default_source,node_id:0,location:default_location,flags:0,predicate:nil,conditions: [],else_clause:nil,case_keyword_loc:location,end_keyword_loc:location)CaseNode.new(source,node_id,location,flags,predicate,conditions,else_clause,case_keyword_loc,end_keyword_loc)end

Create a newCaseNode node.

Source
# File lib/prism/dsl.rb, line 205defclass_node(source:default_source,node_id:0,location:default_location,flags:0,locals: [],class_keyword_loc:location,constant_path:constant_read_node(source:source),inheritance_operator_loc:nil,superclass:nil,body:nil,end_keyword_loc:location,name::"")ClassNode.new(source,node_id,location,flags,locals,class_keyword_loc,constant_path,inheritance_operator_loc,superclass,body,end_keyword_loc,name)end

Create a newClassNode node.

Source
# File lib/prism/dsl.rb, line 210defclass_variable_and_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,operator_loc:location,value:default_node(source,location))ClassVariableAndWriteNode.new(source,node_id,location,flags,name,name_loc,operator_loc,value)end

Create a newClassVariableAndWriteNode node.

Source
# File lib/prism/dsl.rb, line 215defclass_variable_operator_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,binary_operator_loc:location,value:default_node(source,location),binary_operator::"")ClassVariableOperatorWriteNode.new(source,node_id,location,flags,name,name_loc,binary_operator_loc,value,binary_operator)end

Create a newClassVariableOperatorWriteNode node.

Source
# File lib/prism/dsl.rb, line 220defclass_variable_or_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,operator_loc:location,value:default_node(source,location))ClassVariableOrWriteNode.new(source,node_id,location,flags,name,name_loc,operator_loc,value)end

Create a newClassVariableOrWriteNode node.

Source
# File lib/prism/dsl.rb, line 225defclass_variable_read_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")ClassVariableReadNode.new(source,node_id,location,flags,name)end

Create a newClassVariableReadNode node.

Source
# File lib/prism/dsl.rb, line 230defclass_variable_target_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")ClassVariableTargetNode.new(source,node_id,location,flags,name)end

Create a newClassVariableTargetNode node.

Source
# File lib/prism/dsl.rb, line 235defclass_variable_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,value:default_node(source,location),operator_loc:location)ClassVariableWriteNode.new(source,node_id,location,flags,name,name_loc,value,operator_loc)end

Create a newClassVariableWriteNode node.

Source
# File lib/prism/dsl.rb, line 240defconstant_and_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,operator_loc:location,value:default_node(source,location))ConstantAndWriteNode.new(source,node_id,location,flags,name,name_loc,operator_loc,value)end

Create a newConstantAndWriteNode node.

Source
# File lib/prism/dsl.rb, line 245defconstant_operator_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,binary_operator_loc:location,value:default_node(source,location),binary_operator::"")ConstantOperatorWriteNode.new(source,node_id,location,flags,name,name_loc,binary_operator_loc,value,binary_operator)end

Create a newConstantOperatorWriteNode node.

Source
# File lib/prism/dsl.rb, line 250defconstant_or_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,operator_loc:location,value:default_node(source,location))ConstantOrWriteNode.new(source,node_id,location,flags,name,name_loc,operator_loc,value)end

Create a newConstantOrWriteNode node.

Source
# File lib/prism/dsl.rb, line 255defconstant_path_and_write_node(source:default_source,node_id:0,location:default_location,flags:0,target:constant_path_node(source:source),operator_loc:location,value:default_node(source,location))ConstantPathAndWriteNode.new(source,node_id,location,flags,target,operator_loc,value)end

Create a newConstantPathAndWriteNode node.

Source
# File lib/prism/dsl.rb, line 260defconstant_path_node(source:default_source,node_id:0,location:default_location,flags:0,parent:nil,name:nil,delimiter_loc:location,name_loc:location)ConstantPathNode.new(source,node_id,location,flags,parent,name,delimiter_loc,name_loc)end

Create a newConstantPathNode node.

Source
# File lib/prism/dsl.rb, line 265defconstant_path_operator_write_node(source:default_source,node_id:0,location:default_location,flags:0,target:constant_path_node(source:source),binary_operator_loc:location,value:default_node(source,location),binary_operator::"")ConstantPathOperatorWriteNode.new(source,node_id,location,flags,target,binary_operator_loc,value,binary_operator)end

Create a newConstantPathOperatorWriteNode node.

Source
# File lib/prism/dsl.rb, line 270defconstant_path_or_write_node(source:default_source,node_id:0,location:default_location,flags:0,target:constant_path_node(source:source),operator_loc:location,value:default_node(source,location))ConstantPathOrWriteNode.new(source,node_id,location,flags,target,operator_loc,value)end

Create a newConstantPathOrWriteNode node.

Source
# File lib/prism/dsl.rb, line 275defconstant_path_target_node(source:default_source,node_id:0,location:default_location,flags:0,parent:nil,name:nil,delimiter_loc:location,name_loc:location)ConstantPathTargetNode.new(source,node_id,location,flags,parent,name,delimiter_loc,name_loc)end

Create a newConstantPathTargetNode node.

Source
# File lib/prism/dsl.rb, line 280defconstant_path_write_node(source:default_source,node_id:0,location:default_location,flags:0,target:constant_path_node(source:source),operator_loc:location,value:default_node(source,location))ConstantPathWriteNode.new(source,node_id,location,flags,target,operator_loc,value)end

Create a newConstantPathWriteNode node.

Source
# File lib/prism/dsl.rb, line 285defconstant_read_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")ConstantReadNode.new(source,node_id,location,flags,name)end

Create a newConstantReadNode node.

Source
# File lib/prism/dsl.rb, line 290defconstant_target_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")ConstantTargetNode.new(source,node_id,location,flags,name)end

Create a newConstantTargetNode node.

Source
# File lib/prism/dsl.rb, line 295defconstant_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,value:default_node(source,location),operator_loc:location)ConstantWriteNode.new(source,node_id,location,flags,name,name_loc,value,operator_loc)end

Create a newConstantWriteNode node.

Source
# File lib/prism/dsl.rb, line 300defdef_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,receiver:nil,parameters:nil,body:nil,locals: [],def_keyword_loc:location,operator_loc:nil,lparen_loc:nil,rparen_loc:nil,equal_loc:nil,end_keyword_loc:nil)DefNode.new(source,node_id,location,flags,name,name_loc,receiver,parameters,body,locals,def_keyword_loc,operator_loc,lparen_loc,rparen_loc,equal_loc,end_keyword_loc)end

Create a newDefNode node.

Source
# File lib/prism/dsl.rb, line 305defdefined_node(source:default_source,node_id:0,location:default_location,flags:0,lparen_loc:nil,value:default_node(source,location),rparen_loc:nil,keyword_loc:location)DefinedNode.new(source,node_id,location,flags,lparen_loc,value,rparen_loc,keyword_loc)end

Create a newDefinedNode node.

Source
# File lib/prism/dsl.rb, line 310defelse_node(source:default_source,node_id:0,location:default_location,flags:0,else_keyword_loc:location,statements:nil,end_keyword_loc:nil)ElseNode.new(source,node_id,location,flags,else_keyword_loc,statements,end_keyword_loc)end

Create a newElseNode node.

Source
# File lib/prism/dsl.rb, line 315defembedded_statements_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:location,statements:nil,closing_loc:location)EmbeddedStatementsNode.new(source,node_id,location,flags,opening_loc,statements,closing_loc)end

Create a newEmbeddedStatementsNode node.

Source
# File lib/prism/dsl.rb, line 320defembedded_variable_node(source:default_source,node_id:0,location:default_location,flags:0,operator_loc:location,variable:instance_variable_read_node(source:source))EmbeddedVariableNode.new(source,node_id,location,flags,operator_loc,variable)end

Create a newEmbeddedVariableNode node.

Source
# File lib/prism/dsl.rb, line 866defencoding_flag(name)casenamewhen:forced_utf8_encodingthenEncodingFlags::FORCED_UTF8_ENCODINGwhen:forced_binary_encodingthenEncodingFlags::FORCED_BINARY_ENCODINGelseKernel.raiseArgumentError,"invalid EncodingFlags flag: #{name.inspect}"endend

Retrieve the value of one of theEncodingFlags flags.

Source
# File lib/prism/dsl.rb, line 325defensure_node(source:default_source,node_id:0,location:default_location,flags:0,ensure_keyword_loc:location,statements:nil,end_keyword_loc:location)EnsureNode.new(source,node_id,location,flags,ensure_keyword_loc,statements,end_keyword_loc)end

Create a newEnsureNode node.

Source
# File lib/prism/dsl.rb, line 330deffalse_node(source:default_source,node_id:0,location:default_location,flags:0)FalseNode.new(source,node_id,location,flags)end

Create a newFalseNode node.

Source
# File lib/prism/dsl.rb, line 335deffind_pattern_node(source:default_source,node_id:0,location:default_location,flags:0,constant:nil,left:splat_node(source:source),requireds: [],right:splat_node(source:source),opening_loc:nil,closing_loc:nil)FindPatternNode.new(source,node_id,location,flags,constant,left,requireds,right,opening_loc,closing_loc)end

Create a newFindPatternNode node.

Source
# File lib/prism/dsl.rb, line 340defflip_flop_node(source:default_source,node_id:0,location:default_location,flags:0,left:nil,right:nil,operator_loc:location)FlipFlopNode.new(source,node_id,location,flags,left,right,operator_loc)end

Create a newFlipFlopNode node.

Source
# File lib/prism/dsl.rb, line 345deffloat_node(source:default_source,node_id:0,location:default_location,flags:0,value:0.0)FloatNode.new(source,node_id,location,flags,value)end

Create a newFloatNode node.

Source
# File lib/prism/dsl.rb, line 350deffor_node(source:default_source,node_id:0,location:default_location,flags:0,index:local_variable_target_node(source:source),collection:default_node(source,location),statements:nil,for_keyword_loc:location,in_keyword_loc:location,do_keyword_loc:nil,end_keyword_loc:location)ForNode.new(source,node_id,location,flags,index,collection,statements,for_keyword_loc,in_keyword_loc,do_keyword_loc,end_keyword_loc)end

Create a newForNode node.

Source
# File lib/prism/dsl.rb, line 355defforwarding_arguments_node(source:default_source,node_id:0,location:default_location,flags:0)ForwardingArgumentsNode.new(source,node_id,location,flags)end

Create a newForwardingArgumentsNode node.

Source
# File lib/prism/dsl.rb, line 360defforwarding_parameter_node(source:default_source,node_id:0,location:default_location,flags:0)ForwardingParameterNode.new(source,node_id,location,flags)end

Create a newForwardingParameterNode node.

Source
# File lib/prism/dsl.rb, line 365defforwarding_super_node(source:default_source,node_id:0,location:default_location,flags:0,block:nil)ForwardingSuperNode.new(source,node_id,location,flags,block)end

Create a newForwardingSuperNode node.

Source
# File lib/prism/dsl.rb, line 370defglobal_variable_and_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,operator_loc:location,value:default_node(source,location))GlobalVariableAndWriteNode.new(source,node_id,location,flags,name,name_loc,operator_loc,value)end

Create a newGlobalVariableAndWriteNode node.

Source
# File lib/prism/dsl.rb, line 375defglobal_variable_operator_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,binary_operator_loc:location,value:default_node(source,location),binary_operator::"")GlobalVariableOperatorWriteNode.new(source,node_id,location,flags,name,name_loc,binary_operator_loc,value,binary_operator)end

Create a newGlobalVariableOperatorWriteNode node.

Source
# File lib/prism/dsl.rb, line 380defglobal_variable_or_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,operator_loc:location,value:default_node(source,location))GlobalVariableOrWriteNode.new(source,node_id,location,flags,name,name_loc,operator_loc,value)end

Create a newGlobalVariableOrWriteNode node.

Source
# File lib/prism/dsl.rb, line 385defglobal_variable_read_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")GlobalVariableReadNode.new(source,node_id,location,flags,name)end

Create a newGlobalVariableReadNode node.

Source
# File lib/prism/dsl.rb, line 390defglobal_variable_target_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")GlobalVariableTargetNode.new(source,node_id,location,flags,name)end

Create a newGlobalVariableTargetNode node.

Source
# File lib/prism/dsl.rb, line 395defglobal_variable_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,value:default_node(source,location),operator_loc:location)GlobalVariableWriteNode.new(source,node_id,location,flags,name,name_loc,value,operator_loc)end

Create a newGlobalVariableWriteNode node.

Source
# File lib/prism/dsl.rb, line 400defhash_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:location,elements: [],closing_loc:location)HashNode.new(source,node_id,location,flags,opening_loc,elements,closing_loc)end

Create a newHashNode node.

Source
# File lib/prism/dsl.rb, line 405defhash_pattern_node(source:default_source,node_id:0,location:default_location,flags:0,constant:nil,elements: [],rest:nil,opening_loc:nil,closing_loc:nil)HashPatternNode.new(source,node_id,location,flags,constant,elements,rest,opening_loc,closing_loc)end

Create a newHashPatternNode node.

Source
# File lib/prism/dsl.rb, line 410defif_node(source:default_source,node_id:0,location:default_location,flags:0,if_keyword_loc:nil,predicate:default_node(source,location),then_keyword_loc:nil,statements:nil,subsequent:nil,end_keyword_loc:nil)IfNode.new(source,node_id,location,flags,if_keyword_loc,predicate,then_keyword_loc,statements,subsequent,end_keyword_loc)end

Create a newIfNode node.

Source
# File lib/prism/dsl.rb, line 415defimaginary_node(source:default_source,node_id:0,location:default_location,flags:0,numeric:float_node(source:source))ImaginaryNode.new(source,node_id,location,flags,numeric)end

Create a newImaginaryNode node.

Source
# File lib/prism/dsl.rb, line 420defimplicit_node(source:default_source,node_id:0,location:default_location,flags:0,value:local_variable_read_node(source:source))ImplicitNode.new(source,node_id,location,flags,value)end

Create a newImplicitNode node.

Source
# File lib/prism/dsl.rb, line 425defimplicit_rest_node(source:default_source,node_id:0,location:default_location,flags:0)ImplicitRestNode.new(source,node_id,location,flags)end

Create a newImplicitRestNode node.

Source
# File lib/prism/dsl.rb, line 430defin_node(source:default_source,node_id:0,location:default_location,flags:0,pattern:default_node(source,location),statements:nil,in_loc:location,then_loc:nil)InNode.new(source,node_id,location,flags,pattern,statements,in_loc,then_loc)end

Create a newInNode node.

Source
# File lib/prism/dsl.rb, line 435defindex_and_write_node(source:default_source,node_id:0,location:default_location,flags:0,receiver:nil,call_operator_loc:nil,opening_loc:location,arguments:nil,closing_loc:location,block:nil,operator_loc:location,value:default_node(source,location))IndexAndWriteNode.new(source,node_id,location,flags,receiver,call_operator_loc,opening_loc,arguments,closing_loc,block,operator_loc,value)end

Create a newIndexAndWriteNode node.

Source
# File lib/prism/dsl.rb, line 440defindex_operator_write_node(source:default_source,node_id:0,location:default_location,flags:0,receiver:nil,call_operator_loc:nil,opening_loc:location,arguments:nil,closing_loc:location,block:nil,binary_operator::"",binary_operator_loc:location,value:default_node(source,location))IndexOperatorWriteNode.new(source,node_id,location,flags,receiver,call_operator_loc,opening_loc,arguments,closing_loc,block,binary_operator,binary_operator_loc,value)end

Create a newIndexOperatorWriteNode node.

Source
# File lib/prism/dsl.rb, line 445defindex_or_write_node(source:default_source,node_id:0,location:default_location,flags:0,receiver:nil,call_operator_loc:nil,opening_loc:location,arguments:nil,closing_loc:location,block:nil,operator_loc:location,value:default_node(source,location))IndexOrWriteNode.new(source,node_id,location,flags,receiver,call_operator_loc,opening_loc,arguments,closing_loc,block,operator_loc,value)end

Create a newIndexOrWriteNode node.

Source
# File lib/prism/dsl.rb, line 450defindex_target_node(source:default_source,node_id:0,location:default_location,flags:0,receiver:default_node(source,location),opening_loc:location,arguments:nil,closing_loc:location,block:nil)IndexTargetNode.new(source,node_id,location,flags,receiver,opening_loc,arguments,closing_loc,block)end

Create a newIndexTargetNode node.

Source
# File lib/prism/dsl.rb, line 455definstance_variable_and_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,operator_loc:location,value:default_node(source,location))InstanceVariableAndWriteNode.new(source,node_id,location,flags,name,name_loc,operator_loc,value)end

Create a newInstanceVariableAndWriteNode node.

Source
# File lib/prism/dsl.rb, line 460definstance_variable_operator_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,binary_operator_loc:location,value:default_node(source,location),binary_operator::"")InstanceVariableOperatorWriteNode.new(source,node_id,location,flags,name,name_loc,binary_operator_loc,value,binary_operator)end

Create a newInstanceVariableOperatorWriteNode node.

Source
# File lib/prism/dsl.rb, line 465definstance_variable_or_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,operator_loc:location,value:default_node(source,location))InstanceVariableOrWriteNode.new(source,node_id,location,flags,name,name_loc,operator_loc,value)end

Create a newInstanceVariableOrWriteNode node.

Source
# File lib/prism/dsl.rb, line 470definstance_variable_read_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")InstanceVariableReadNode.new(source,node_id,location,flags,name)end

Create a newInstanceVariableReadNode node.

Source
# File lib/prism/dsl.rb, line 475definstance_variable_target_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")InstanceVariableTargetNode.new(source,node_id,location,flags,name)end

Create a newInstanceVariableTargetNode node.

Source
# File lib/prism/dsl.rb, line 480definstance_variable_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,value:default_node(source,location),operator_loc:location)InstanceVariableWriteNode.new(source,node_id,location,flags,name,name_loc,value,operator_loc)end

Create a newInstanceVariableWriteNode node.

Source
# File lib/prism/dsl.rb, line 875definteger_base_flag(name)casenamewhen:binarythenIntegerBaseFlags::BINARYwhen:decimalthenIntegerBaseFlags::DECIMALwhen:octalthenIntegerBaseFlags::OCTALwhen:hexadecimalthenIntegerBaseFlags::HEXADECIMALelseKernel.raiseArgumentError,"invalid IntegerBaseFlags flag: #{name.inspect}"endend

Retrieve the value of one of theIntegerBaseFlags flags.

Source
# File lib/prism/dsl.rb, line 485definteger_node(source:default_source,node_id:0,location:default_location,flags:0,value:0)IntegerNode.new(source,node_id,location,flags,value)end

Create a newIntegerNode node.

Source
# File lib/prism/dsl.rb, line 490definterpolated_match_last_line_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:location,parts: [],closing_loc:location)InterpolatedMatchLastLineNode.new(source,node_id,location,flags,opening_loc,parts,closing_loc)end

Create a newInterpolatedMatchLastLineNode node.

Source
# File lib/prism/dsl.rb, line 495definterpolated_regular_expression_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:location,parts: [],closing_loc:location)InterpolatedRegularExpressionNode.new(source,node_id,location,flags,opening_loc,parts,closing_loc)end

Create a newInterpolatedRegularExpressionNode node.

Source
# File lib/prism/dsl.rb, line 500definterpolated_string_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:nil,parts: [],closing_loc:nil)InterpolatedStringNode.new(source,node_id,location,flags,opening_loc,parts,closing_loc)end

Create a newInterpolatedStringNode node.

Source
# File lib/prism/dsl.rb, line 886definterpolated_string_node_flag(name)casenamewhen:frozenthenInterpolatedStringNodeFlags::FROZENwhen:mutablethenInterpolatedStringNodeFlags::MUTABLEelseKernel.raiseArgumentError,"invalid InterpolatedStringNodeFlags flag: #{name.inspect}"endend

Retrieve the value of one of theInterpolatedStringNodeFlags flags.

Source
# File lib/prism/dsl.rb, line 505definterpolated_symbol_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:nil,parts: [],closing_loc:nil)InterpolatedSymbolNode.new(source,node_id,location,flags,opening_loc,parts,closing_loc)end

Create a newInterpolatedSymbolNode node.

Source
# File lib/prism/dsl.rb, line 510definterpolated_x_string_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:location,parts: [],closing_loc:location)InterpolatedXStringNode.new(source,node_id,location,flags,opening_loc,parts,closing_loc)end

Create a newInterpolatedXStringNode node.

Source
# File lib/prism/dsl.rb, line 515defit_local_variable_read_node(source:default_source,node_id:0,location:default_location,flags:0)ItLocalVariableReadNode.new(source,node_id,location,flags)end

Create a newItLocalVariableReadNode node.

Source
# File lib/prism/dsl.rb, line 520defit_parameters_node(source:default_source,node_id:0,location:default_location,flags:0)ItParametersNode.new(source,node_id,location,flags)end

Create a newItParametersNode node.

Source
# File lib/prism/dsl.rb, line 525defkeyword_hash_node(source:default_source,node_id:0,location:default_location,flags:0,elements: [])KeywordHashNode.new(source,node_id,location,flags,elements)end

Create a newKeywordHashNode node.

Source
# File lib/prism/dsl.rb, line 895defkeyword_hash_node_flag(name)casenamewhen:symbol_keysthenKeywordHashNodeFlags::SYMBOL_KEYSelseKernel.raiseArgumentError,"invalid KeywordHashNodeFlags flag: #{name.inspect}"endend

Retrieve the value of one of theKeywordHashNodeFlags flags.

Source
# File lib/prism/dsl.rb, line 530defkeyword_rest_parameter_node(source:default_source,node_id:0,location:default_location,flags:0,name:nil,name_loc:nil,operator_loc:location)KeywordRestParameterNode.new(source,node_id,location,flags,name,name_loc,operator_loc)end

Create a newKeywordRestParameterNode node.

Source
# File lib/prism/dsl.rb, line 535deflambda_node(source:default_source,node_id:0,location:default_location,flags:0,locals: [],operator_loc:location,opening_loc:location,closing_loc:location,parameters:nil,body:nil)LambdaNode.new(source,node_id,location,flags,locals,operator_loc,opening_loc,closing_loc,parameters,body)end

Create a newLambdaNode node.

Source
# File lib/prism/dsl.rb, line 540deflocal_variable_and_write_node(source:default_source,node_id:0,location:default_location,flags:0,name_loc:location,operator_loc:location,value:default_node(source,location),name::"",depth:0)LocalVariableAndWriteNode.new(source,node_id,location,flags,name_loc,operator_loc,value,name,depth)end

Create a newLocalVariableAndWriteNode node.

Source
# File lib/prism/dsl.rb, line 545deflocal_variable_operator_write_node(source:default_source,node_id:0,location:default_location,flags:0,name_loc:location,binary_operator_loc:location,value:default_node(source,location),name::"",binary_operator::"",depth:0)LocalVariableOperatorWriteNode.new(source,node_id,location,flags,name_loc,binary_operator_loc,value,name,binary_operator,depth)end

Create a newLocalVariableOperatorWriteNode node.

Source
# File lib/prism/dsl.rb, line 550deflocal_variable_or_write_node(source:default_source,node_id:0,location:default_location,flags:0,name_loc:location,operator_loc:location,value:default_node(source,location),name::"",depth:0)LocalVariableOrWriteNode.new(source,node_id,location,flags,name_loc,operator_loc,value,name,depth)end

Create a newLocalVariableOrWriteNode node.

Source
# File lib/prism/dsl.rb, line 555deflocal_variable_read_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",depth:0)LocalVariableReadNode.new(source,node_id,location,flags,name,depth)end

Create a newLocalVariableReadNode node.

Source
# File lib/prism/dsl.rb, line 560deflocal_variable_target_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",depth:0)LocalVariableTargetNode.new(source,node_id,location,flags,name,depth)end

Create a newLocalVariableTargetNode node.

Source
# File lib/prism/dsl.rb, line 565deflocal_variable_write_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",depth:0,name_loc:location,value:default_node(source,location),operator_loc:location)LocalVariableWriteNode.new(source,node_id,location,flags,name,depth,name_loc,value,operator_loc)end

Create a newLocalVariableWriteNode node.

Source
# File lib/prism/dsl.rb, line 75deflocation(source:default_source,start_offset:0,length:0)Location.new(source,start_offset,length)end

Create a newLocation object.

Source
# File lib/prism/dsl.rb, line 903defloop_flag(name)casenamewhen:begin_modifierthenLoopFlags::BEGIN_MODIFIERelseKernel.raiseArgumentError,"invalid LoopFlags flag: #{name.inspect}"endend

Retrieve the value of one of theLoopFlags flags.

Source
# File lib/prism/dsl.rb, line 570defmatch_last_line_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:location,content_loc:location,closing_loc:location,unescaped:"")MatchLastLineNode.new(source,node_id,location,flags,opening_loc,content_loc,closing_loc,unescaped)end

Create a newMatchLastLineNode node.

Source
# File lib/prism/dsl.rb, line 575defmatch_predicate_node(source:default_source,node_id:0,location:default_location,flags:0,value:default_node(source,location),pattern:default_node(source,location),operator_loc:location)MatchPredicateNode.new(source,node_id,location,flags,value,pattern,operator_loc)end

Create a newMatchPredicateNode node.

Source
# File lib/prism/dsl.rb, line 580defmatch_required_node(source:default_source,node_id:0,location:default_location,flags:0,value:default_node(source,location),pattern:default_node(source,location),operator_loc:location)MatchRequiredNode.new(source,node_id,location,flags,value,pattern,operator_loc)end

Create a newMatchRequiredNode node.

Source
# File lib/prism/dsl.rb, line 585defmatch_write_node(source:default_source,node_id:0,location:default_location,flags:0,call:call_node(source:source),targets: [])MatchWriteNode.new(source,node_id,location,flags,call,targets)end

Create a newMatchWriteNode node.

Source
# File lib/prism/dsl.rb, line 590defmissing_node(source:default_source,node_id:0,location:default_location,flags:0)MissingNode.new(source,node_id,location,flags)end

Create a newMissingNode node.

Source
# File lib/prism/dsl.rb, line 595defmodule_node(source:default_source,node_id:0,location:default_location,flags:0,locals: [],module_keyword_loc:location,constant_path:constant_read_node(source:source),body:nil,end_keyword_loc:location,name::"")ModuleNode.new(source,node_id,location,flags,locals,module_keyword_loc,constant_path,body,end_keyword_loc,name)end

Create a newModuleNode node.

Source
# File lib/prism/dsl.rb, line 600defmulti_target_node(source:default_source,node_id:0,location:default_location,flags:0,lefts: [],rest:nil,rights: [],lparen_loc:nil,rparen_loc:nil)MultiTargetNode.new(source,node_id,location,flags,lefts,rest,rights,lparen_loc,rparen_loc)end

Create a newMultiTargetNode node.

Source
# File lib/prism/dsl.rb, line 605defmulti_write_node(source:default_source,node_id:0,location:default_location,flags:0,lefts: [],rest:nil,rights: [],lparen_loc:nil,rparen_loc:nil,operator_loc:location,value:default_node(source,location))MultiWriteNode.new(source,node_id,location,flags,lefts,rest,rights,lparen_loc,rparen_loc,operator_loc,value)end

Create a newMultiWriteNode node.

Source
# File lib/prism/dsl.rb, line 610defnext_node(source:default_source,node_id:0,location:default_location,flags:0,arguments:nil,keyword_loc:location)NextNode.new(source,node_id,location,flags,arguments,keyword_loc)end

Create a newNextNode node.

Source
# File lib/prism/dsl.rb, line 615defnil_node(source:default_source,node_id:0,location:default_location,flags:0)NilNode.new(source,node_id,location,flags)end

Create a newNilNode node.

Source
# File lib/prism/dsl.rb, line 620defno_keywords_parameter_node(source:default_source,node_id:0,location:default_location,flags:0,operator_loc:location,keyword_loc:location)NoKeywordsParameterNode.new(source,node_id,location,flags,operator_loc,keyword_loc)end

Create a newNoKeywordsParameterNode node.

Source
# File lib/prism/dsl.rb, line 625defnumbered_parameters_node(source:default_source,node_id:0,location:default_location,flags:0,maximum:0)NumberedParametersNode.new(source,node_id,location,flags,maximum)end

Create a newNumberedParametersNode node.

Source
# File lib/prism/dsl.rb, line 630defnumbered_reference_read_node(source:default_source,node_id:0,location:default_location,flags:0,number:0)NumberedReferenceReadNode.new(source,node_id,location,flags,number)end

Create a newNumberedReferenceReadNode node.

Source
# File lib/prism/dsl.rb, line 635defoptional_keyword_parameter_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,value:default_node(source,location))OptionalKeywordParameterNode.new(source,node_id,location,flags,name,name_loc,value)end

Create a newOptionalKeywordParameterNode node.

Source
# File lib/prism/dsl.rb, line 640defoptional_parameter_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location,operator_loc:location,value:default_node(source,location))OptionalParameterNode.new(source,node_id,location,flags,name,name_loc,operator_loc,value)end

Create a newOptionalParameterNode node.

Source
# File lib/prism/dsl.rb, line 645defor_node(source:default_source,node_id:0,location:default_location,flags:0,left:default_node(source,location),right:default_node(source,location),operator_loc:location)OrNode.new(source,node_id,location,flags,left,right,operator_loc)end

Create a newOrNode node.

Source
# File lib/prism/dsl.rb, line 911defparameter_flag(name)casenamewhen:repeated_parameterthenParameterFlags::REPEATED_PARAMETERelseKernel.raiseArgumentError,"invalid ParameterFlags flag: #{name.inspect}"endend

Retrieve the value of one of theParameterFlags flags.

Source
# File lib/prism/dsl.rb, line 650defparameters_node(source:default_source,node_id:0,location:default_location,flags:0,requireds: [],optionals: [],rest:nil,posts: [],keywords: [],keyword_rest:nil,block:nil)ParametersNode.new(source,node_id,location,flags,requireds,optionals,rest,posts,keywords,keyword_rest,block)end

Create a newParametersNode node.

Source
# File lib/prism/dsl.rb, line 655defparentheses_node(source:default_source,node_id:0,location:default_location,flags:0,body:nil,opening_loc:location,closing_loc:location)ParenthesesNode.new(source,node_id,location,flags,body,opening_loc,closing_loc)end

Create a newParenthesesNode node.

Source
# File lib/prism/dsl.rb, line 919defparentheses_node_flag(name)casenamewhen:multiple_statementsthenParenthesesNodeFlags::MULTIPLE_STATEMENTSelseKernel.raiseArgumentError,"invalid ParenthesesNodeFlags flag: #{name.inspect}"endend

Retrieve the value of one of theParenthesesNodeFlags flags.

Source
# File lib/prism/dsl.rb, line 660defpinned_expression_node(source:default_source,node_id:0,location:default_location,flags:0,expression:default_node(source,location),operator_loc:location,lparen_loc:location,rparen_loc:location)PinnedExpressionNode.new(source,node_id,location,flags,expression,operator_loc,lparen_loc,rparen_loc)end

Create a newPinnedExpressionNode node.

Source
# File lib/prism/dsl.rb, line 665defpinned_variable_node(source:default_source,node_id:0,location:default_location,flags:0,variable:local_variable_read_node(source:source),operator_loc:location)PinnedVariableNode.new(source,node_id,location,flags,variable,operator_loc)end

Create a newPinnedVariableNode node.

Source
# File lib/prism/dsl.rb, line 670defpost_execution_node(source:default_source,node_id:0,location:default_location,flags:0,statements:nil,keyword_loc:location,opening_loc:location,closing_loc:location)PostExecutionNode.new(source,node_id,location,flags,statements,keyword_loc,opening_loc,closing_loc)end

Create a newPostExecutionNode node.

Source
# File lib/prism/dsl.rb, line 675defpre_execution_node(source:default_source,node_id:0,location:default_location,flags:0,statements:nil,keyword_loc:location,opening_loc:location,closing_loc:location)PreExecutionNode.new(source,node_id,location,flags,statements,keyword_loc,opening_loc,closing_loc)end

Create a newPreExecutionNode node.

Source
# File lib/prism/dsl.rb, line 680defprogram_node(source:default_source,node_id:0,location:default_location,flags:0,locals: [],statements:statements_node(source:source))ProgramNode.new(source,node_id,location,flags,locals,statements)end

Create a newProgramNode node.

Source
# File lib/prism/dsl.rb, line 927defrange_flag(name)casenamewhen:exclude_endthenRangeFlags::EXCLUDE_ENDelseKernel.raiseArgumentError,"invalid RangeFlags flag: #{name.inspect}"endend

Retrieve the value of one of theRangeFlags flags.

Source
# File lib/prism/dsl.rb, line 685defrange_node(source:default_source,node_id:0,location:default_location,flags:0,left:nil,right:nil,operator_loc:location)RangeNode.new(source,node_id,location,flags,left,right,operator_loc)end

Create a newRangeNode node.

Source
# File lib/prism/dsl.rb, line 690defrational_node(source:default_source,node_id:0,location:default_location,flags:0,numerator:0,denominator:0)RationalNode.new(source,node_id,location,flags,numerator,denominator)end

Create a newRationalNode node.

Source
# File lib/prism/dsl.rb, line 695defredo_node(source:default_source,node_id:0,location:default_location,flags:0)RedoNode.new(source,node_id,location,flags)end

Create a newRedoNode node.

Source
# File lib/prism/dsl.rb, line 935defregular_expression_flag(name)casenamewhen:ignore_casethenRegularExpressionFlags::IGNORE_CASEwhen:extendedthenRegularExpressionFlags::EXTENDEDwhen:multi_linethenRegularExpressionFlags::MULTI_LINEwhen:oncethenRegularExpressionFlags::ONCEwhen:euc_jpthenRegularExpressionFlags::EUC_JPwhen:ascii_8bitthenRegularExpressionFlags::ASCII_8BITwhen:windows_31jthenRegularExpressionFlags::WINDOWS_31Jwhen:utf_8thenRegularExpressionFlags::UTF_8when:forced_utf8_encodingthenRegularExpressionFlags::FORCED_UTF8_ENCODINGwhen:forced_binary_encodingthenRegularExpressionFlags::FORCED_BINARY_ENCODINGwhen:forced_us_ascii_encodingthenRegularExpressionFlags::FORCED_US_ASCII_ENCODINGelseKernel.raiseArgumentError,"invalid RegularExpressionFlags flag: #{name.inspect}"endend

Retrieve the value of one of theRegularExpressionFlags flags.

Source
# File lib/prism/dsl.rb, line 700defregular_expression_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:location,content_loc:location,closing_loc:location,unescaped:"")RegularExpressionNode.new(source,node_id,location,flags,opening_loc,content_loc,closing_loc,unescaped)end

Create a newRegularExpressionNode node.

Source
# File lib/prism/dsl.rb, line 705defrequired_keyword_parameter_node(source:default_source,node_id:0,location:default_location,flags:0,name::"",name_loc:location)RequiredKeywordParameterNode.new(source,node_id,location,flags,name,name_loc)end

Create a newRequiredKeywordParameterNode node.

Source
# File lib/prism/dsl.rb, line 710defrequired_parameter_node(source:default_source,node_id:0,location:default_location,flags:0,name::"")RequiredParameterNode.new(source,node_id,location,flags,name)end

Create a newRequiredParameterNode node.

Source
# File lib/prism/dsl.rb, line 715defrescue_modifier_node(source:default_source,node_id:0,location:default_location,flags:0,expression:default_node(source,location),keyword_loc:location,rescue_expression:default_node(source,location))RescueModifierNode.new(source,node_id,location,flags,expression,keyword_loc,rescue_expression)end

Create a newRescueModifierNode node.

Source
# File lib/prism/dsl.rb, line 720defrescue_node(source:default_source,node_id:0,location:default_location,flags:0,keyword_loc:location,exceptions: [],operator_loc:nil,reference:nil,then_keyword_loc:nil,statements:nil,subsequent:nil)RescueNode.new(source,node_id,location,flags,keyword_loc,exceptions,operator_loc,reference,then_keyword_loc,statements,subsequent)end

Create a newRescueNode node.

Source
# File lib/prism/dsl.rb, line 725defrest_parameter_node(source:default_source,node_id:0,location:default_location,flags:0,name:nil,name_loc:nil,operator_loc:location)RestParameterNode.new(source,node_id,location,flags,name,name_loc,operator_loc)end

Create a newRestParameterNode node.

Source
# File lib/prism/dsl.rb, line 730defretry_node(source:default_source,node_id:0,location:default_location,flags:0)RetryNode.new(source,node_id,location,flags)end

Create a newRetryNode node.

Source
# File lib/prism/dsl.rb, line 735defreturn_node(source:default_source,node_id:0,location:default_location,flags:0,keyword_loc:location,arguments:nil)ReturnNode.new(source,node_id,location,flags,keyword_loc,arguments)end

Create a newReturnNode node.

Source
# File lib/prism/dsl.rb, line 740defself_node(source:default_source,node_id:0,location:default_location,flags:0)SelfNode.new(source,node_id,location,flags)end

Create a newSelfNode node.

Source
# File lib/prism/dsl.rb, line 745defshareable_constant_node(source:default_source,node_id:0,location:default_location,flags:0,write:constant_write_node(source:source))ShareableConstantNode.new(source,node_id,location,flags,write)end

Create a newShareableConstantNode node.

Source
# File lib/prism/dsl.rb, line 953defshareable_constant_node_flag(name)casenamewhen:literalthenShareableConstantNodeFlags::LITERALwhen:experimental_everythingthenShareableConstantNodeFlags::EXPERIMENTAL_EVERYTHINGwhen:experimental_copythenShareableConstantNodeFlags::EXPERIMENTAL_COPYelseKernel.raiseArgumentError,"invalid ShareableConstantNodeFlags flag: #{name.inspect}"endend

Retrieve the value of one of theShareableConstantNodeFlags flags.

Source
# File lib/prism/dsl.rb, line 750defsingleton_class_node(source:default_source,node_id:0,location:default_location,flags:0,locals: [],class_keyword_loc:location,operator_loc:location,expression:default_node(source,location),body:nil,end_keyword_loc:location)SingletonClassNode.new(source,node_id,location,flags,locals,class_keyword_loc,operator_loc,expression,body,end_keyword_loc)end

Create a newSingletonClassNode node.

Source
# File lib/prism/dsl.rb, line 70defsource(string)Source.for(string)end

Create a newSource object.

Source
# File lib/prism/dsl.rb, line 755defsource_encoding_node(source:default_source,node_id:0,location:default_location,flags:0)SourceEncodingNode.new(source,node_id,location,flags)end

Create a newSourceEncodingNode node.

Source
# File lib/prism/dsl.rb, line 760defsource_file_node(source:default_source,node_id:0,location:default_location,flags:0,filepath:"")SourceFileNode.new(source,node_id,location,flags,filepath)end

Create a newSourceFileNode node.

Source
# File lib/prism/dsl.rb, line 765defsource_line_node(source:default_source,node_id:0,location:default_location,flags:0)SourceLineNode.new(source,node_id,location,flags)end

Create a newSourceLineNode node.

Source
# File lib/prism/dsl.rb, line 770defsplat_node(source:default_source,node_id:0,location:default_location,flags:0,operator_loc:location,expression:nil)SplatNode.new(source,node_id,location,flags,operator_loc,expression)end

Create a newSplatNode node.

Source
# File lib/prism/dsl.rb, line 775defstatements_node(source:default_source,node_id:0,location:default_location,flags:0,body: [])StatementsNode.new(source,node_id,location,flags,body)end

Create a newStatementsNode node.

Source
# File lib/prism/dsl.rb, line 963defstring_flag(name)casenamewhen:forced_utf8_encodingthenStringFlags::FORCED_UTF8_ENCODINGwhen:forced_binary_encodingthenStringFlags::FORCED_BINARY_ENCODINGwhen:frozenthenStringFlags::FROZENwhen:mutablethenStringFlags::MUTABLEelseKernel.raiseArgumentError,"invalid StringFlags flag: #{name.inspect}"endend

Retrieve the value of one of theStringFlags flags.

Source
# File lib/prism/dsl.rb, line 780defstring_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:nil,content_loc:location,closing_loc:nil,unescaped:"")StringNode.new(source,node_id,location,flags,opening_loc,content_loc,closing_loc,unescaped)end

Create a newStringNode node.

Source
# File lib/prism/dsl.rb, line 785defsuper_node(source:default_source,node_id:0,location:default_location,flags:0,keyword_loc:location,lparen_loc:nil,arguments:nil,rparen_loc:nil,block:nil)SuperNode.new(source,node_id,location,flags,keyword_loc,lparen_loc,arguments,rparen_loc,block)end

Create a newSuperNode node.

Source
# File lib/prism/dsl.rb, line 974defsymbol_flag(name)casenamewhen:forced_utf8_encodingthenSymbolFlags::FORCED_UTF8_ENCODINGwhen:forced_binary_encodingthenSymbolFlags::FORCED_BINARY_ENCODINGwhen:forced_us_ascii_encodingthenSymbolFlags::FORCED_US_ASCII_ENCODINGelseKernel.raiseArgumentError,"invalid SymbolFlags flag: #{name.inspect}"endend

Retrieve the value of one of theSymbolFlags flags.

Source
# File lib/prism/dsl.rb, line 790defsymbol_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:nil,value_loc:nil,closing_loc:nil,unescaped:"")SymbolNode.new(source,node_id,location,flags,opening_loc,value_loc,closing_loc,unescaped)end

Create a newSymbolNode node.

Source
# File lib/prism/dsl.rb, line 795deftrue_node(source:default_source,node_id:0,location:default_location,flags:0)TrueNode.new(source,node_id,location,flags)end

Create a newTrueNode node.

Source
# File lib/prism/dsl.rb, line 800defundef_node(source:default_source,node_id:0,location:default_location,flags:0,names: [],keyword_loc:location)UndefNode.new(source,node_id,location,flags,names,keyword_loc)end

Create a newUndefNode node.

Source
# File lib/prism/dsl.rb, line 805defunless_node(source:default_source,node_id:0,location:default_location,flags:0,keyword_loc:location,predicate:default_node(source,location),then_keyword_loc:nil,statements:nil,else_clause:nil,end_keyword_loc:nil)UnlessNode.new(source,node_id,location,flags,keyword_loc,predicate,then_keyword_loc,statements,else_clause,end_keyword_loc)end

Create a newUnlessNode node.

Source
# File lib/prism/dsl.rb, line 810defuntil_node(source:default_source,node_id:0,location:default_location,flags:0,keyword_loc:location,do_keyword_loc:nil,closing_loc:nil,predicate:default_node(source,location),statements:nil)UntilNode.new(source,node_id,location,flags,keyword_loc,do_keyword_loc,closing_loc,predicate,statements)end

Create a newUntilNode node.

Source
# File lib/prism/dsl.rb, line 815defwhen_node(source:default_source,node_id:0,location:default_location,flags:0,keyword_loc:location,conditions: [],then_keyword_loc:nil,statements:nil)WhenNode.new(source,node_id,location,flags,keyword_loc,conditions,then_keyword_loc,statements)end

Create a newWhenNode node.

Source
# File lib/prism/dsl.rb, line 820defwhile_node(source:default_source,node_id:0,location:default_location,flags:0,keyword_loc:location,do_keyword_loc:nil,closing_loc:nil,predicate:default_node(source,location),statements:nil)WhileNode.new(source,node_id,location,flags,keyword_loc,do_keyword_loc,closing_loc,predicate,statements)end

Create a newWhileNode node.

Source
# File lib/prism/dsl.rb, line 825defx_string_node(source:default_source,node_id:0,location:default_location,flags:0,opening_loc:location,content_loc:location,closing_loc:location,unescaped:"")XStringNode.new(source,node_id,location,flags,opening_loc,content_loc,closing_loc,unescaped)end

Create a newXStringNode node.

Source
# File lib/prism/dsl.rb, line 830defyield_node(source:default_source,node_id:0,location:default_location,flags:0,keyword_loc:location,lparen_loc:nil,arguments:nil,rparen_loc:nil)YieldNode.new(source,node_id,location,flags,keyword_loc,lparen_loc,arguments,rparen_loc)end

Create a newYieldNode node.

Private Instance Methods

Source
# File lib/prism/dsl.rb, line 993defdefault_locationLocation.new(default_source,0,0)end

The default location object that gets attached to nodes if no location is specified, which uses the given source.

Source
# File lib/prism/dsl.rb, line 999defdefault_node(source,location)MissingNode.new(source,-1,location,0)end

The default node that gets attached to nodes if no node is specified for a required node field.

Source
# File lib/prism/dsl.rb, line 987defdefault_sourceSource.for("")end

The default source object that gets attached to nodes and locations if no source is specified.