D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Prism
/
DSL
/
Filename :
cdesc-DSL.ri
back
Copy
U:RDoc::NormalModule[iI"DSL:ETI"Prism::DSL;T0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"OThe DSL module provides a set of methods that can be used to create prism ;TI"Enodes in a more concise manner. For example, instead of writing:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim;[I"'source = Prism::Source.for("[1]") ;TI" ;TI"Prism::ArrayNode.new( ;TI" source, ;TI" 0, ;TI"* Prism::Location.new(source, 0, 3), ;TI" 0, ;TI" [ ;TI"! Prism::IntegerNode.new( ;TI" source, ;TI" 0, ;TI". Prism::Location.new(source, 1, 1), ;TI"- Prism::IntegerBaseFlags::DECIMAL, ;TI" 1 ;TI" ) ;TI" ], ;TI"* Prism::Location.new(source, 0, 1), ;TI") Prism::Location.new(source, 2, 1) ;TI") ;T:@format0o; ;[I"you could instead write:;T@o;;[I"class Builder ;TI" include Prism::DSL ;TI" ;TI"# attr_reader :default_source ;TI" ;TI" def initialize ;TI") @default_source = source("[1]") ;TI" end ;TI" ;TI" def build ;TI" array_node( ;TI"; location: location(start_offset: 0, length: 3), ;TI" elements: [ ;TI" integer_node( ;TI"? location: location(start_offset: 1, length: 1), ;TI"3 flags: integer_base_flag(:decimal), ;TI" value: 1 ;TI" ) ;TI" ], ;TI"> opening_loc: location(start_offset: 0, length: 1), ;TI"= closing_loc: location(start_offset: 2, length: 1) ;TI" ) ;TI" end ;TI" end ;T;0o; ;[I"PThis is mostly helpful in the context of generating trees programmatically.;T: @fileI"lib/prism/dsl.rb;T:0@omit_headings_from_table_of_contents_below0; 0;0[ [ [ [[I" class;T[[:public[ [:protected[ [:private[ [I" instance;T[[;[�[I"alias_global_variable_node;TI"lib/prism/dsl.rb;T[I"alias_method_node;T@\[I"alternation_pattern_node;T@\[I" and_node;T@\[I"arguments_node;T@\[I"arguments_node_flag;T@\[I"array_node;T@\[I"array_node_flag;T@\[I"array_pattern_node;T@\[I"assoc_node;T@\[I"assoc_splat_node;T@\[I"back_reference_read_node;T@\[I"begin_node;T@\[I"block_argument_node;T@\[I"block_local_variable_node;T@\[I"block_node;T@\[I"block_parameter_node;T@\[I"block_parameters_node;T@\[I"break_node;T@\[I"call_and_write_node;T@\[I"call_node;T@\[I"call_node_flag;T@\[I"call_operator_write_node;T@\[I"call_or_write_node;T@\[I"call_target_node;T@\[I"capture_pattern_node;T@\[I"case_match_node;T@\[I"case_node;T@\[I"class_node;T@\[I""class_variable_and_write_node;T@\[I"'class_variable_operator_write_node;T@\[I"!class_variable_or_write_node;T@\[I"class_variable_read_node;T@\[I"class_variable_target_node;T@\[I"class_variable_write_node;T@\[I"constant_and_write_node;T@\[I"!constant_operator_write_node;T@\[I"constant_or_write_node;T@\[I"!constant_path_and_write_node;T@\[I"constant_path_node;T@\[I"&constant_path_operator_write_node;T@\[I" constant_path_or_write_node;T@\[I"constant_path_target_node;T@\[I"constant_path_write_node;T@\[I"constant_read_node;T@\[I"constant_target_node;T@\[I"constant_write_node;T@\[I" def_node;T@\[I"defined_node;T@\[I"else_node;T@\[I"embedded_statements_node;T@\[I"embedded_variable_node;T@\[I"encoding_flag;T@\[I"ensure_node;T@\[I"false_node;T@\[I"find_pattern_node;T@\[I"flip_flop_node;T@\[I"float_node;T@\[I" for_node;T@\[I"forwarding_arguments_node;T@\[I"forwarding_parameter_node;T@\[I"forwarding_super_node;T@\[I"#global_variable_and_write_node;T@\[I"(global_variable_operator_write_node;T@\[I""global_variable_or_write_node;T@\[I"global_variable_read_node;T@\[I" global_variable_target_node;T@\[I"global_variable_write_node;T@\[I"hash_node;T@\[I"hash_pattern_node;T@\[I"if_node;T@\[I"imaginary_node;T@\[I"implicit_node;T@\[I"implicit_rest_node;T@\[I"in_node;T@\[I"index_and_write_node;T@\[I"index_operator_write_node;T@\[I"index_or_write_node;T@\[I"index_target_node;T@\[I"%instance_variable_and_write_node;T@\[I"*instance_variable_operator_write_node;T@\[I"$instance_variable_or_write_node;T@\[I" instance_variable_read_node;T@\[I""instance_variable_target_node;T@\[I"!instance_variable_write_node;T@\[I"integer_base_flag;T@\[I"integer_node;T@\[I"&interpolated_match_last_line_node;T@\[I")interpolated_regular_expression_node;T@\[I"interpolated_string_node;T@\[I""interpolated_string_node_flag;T@\[I"interpolated_symbol_node;T@\[I"interpolated_x_string_node;T@\[I" it_local_variable_read_node;T@\[I"it_parameters_node;T@\[I"keyword_hash_node;T@\[I"keyword_hash_node_flag;T@\[I" keyword_rest_parameter_node;T@\[I"lambda_node;T@\[I""local_variable_and_write_node;T@\[I"'local_variable_operator_write_node;T@\[I"!local_variable_or_write_node;T@\[I"local_variable_read_node;T@\[I"local_variable_target_node;T@\[I"local_variable_write_node;T@\[I" location;T@\[I"loop_flag;T@\[I"match_last_line_node;T@\[I"match_predicate_node;T@\[I"match_required_node;T@\[I"match_write_node;T@\[I"missing_node;T@\[I"module_node;T@\[I"multi_target_node;T@\[I"multi_write_node;T@\[I"next_node;T@\[I" nil_node;T@\[I"no_keywords_parameter_node;T@\[I"numbered_parameters_node;T@\[I"!numbered_reference_read_node;T@\[I"$optional_keyword_parameter_node;T@\[I"optional_parameter_node;T@\[I"or_node;T@\[I"parameter_flag;T@\[I"parameters_node;T@\[I"parentheses_node;T@\[I"pinned_expression_node;T@\[I"pinned_variable_node;T@\[I"post_execution_node;T@\[I"pre_execution_node;T@\[I"program_node;T@\[I"range_flag;T@\[I"range_node;T@\[I"rational_node;T@\[I"redo_node;T@\[I"regular_expression_flag;T@\[I"regular_expression_node;T@\[I"$required_keyword_parameter_node;T@\[I"required_parameter_node;T@\[I"rescue_modifier_node;T@\[I"rescue_node;T@\[I"rest_parameter_node;T@\[I"retry_node;T@\[I"return_node;T@\[I"self_node;T@\[I"shareable_constant_node;T@\[I"!shareable_constant_node_flag;T@\[I"singleton_class_node;T@\[I"source;T@\[I"source_encoding_node;T@\[I"source_file_node;T@\[I"source_line_node;T@\[I"splat_node;T@\[I"statements_node;T@\[I"string_flag;T@\[I"string_node;T@\[I"super_node;T@\[I"symbol_flag;T@\[I"symbol_node;T@\[I"true_node;T@\[I"undef_node;T@\[I"unless_node;T@\[I"until_node;T@\[I"when_node;T@\[I"while_node;T@\[I"x_string_node;T@\[I"yield_node;T@\[;[ [;[[I"default_location;T@\[I"default_node;T@\[I"default_source;T@\[ [U:RDoc::Context::Section[i 0o;;[ ; 0;0[@GI" Prism;TcRDoc::NormalModule