Class: RedParse::UndefNode
- Includes:
- BareSymbolUtils
- Defined in:
- lib/redparse/node.rb
Constant Summary
Constants included from FlattenedIvars
FlattenedIvars::EXCLUDED_IVARS
Instance Attribute Summary
Attributes inherited from Node
#endline, #errors, #offset, #parent, #startline
Attributes included from Stackable::Meta
#boolean_identity_params, #identity_params
Instance Method Summary collapse
- #image ⇒ Object
-
#initialize(first, middle, last = nil) ⇒ UndefNode
constructor
A new instance of UndefNode.
- #parsetree(o) ⇒ Object
- #unparse(o = default_unparse_options) ⇒ Object
Methods included from BareSymbolUtils
#baresym2str, #str2parsetree, #str_unparse
Methods inherited from ValueNode
Methods inherited from Node
#+, #+@, #==, [], #[]=, #add_parent_links!, #begin_parsetree, create, #data, #deep_copy, #delete_extraneous_ivars!, #delete_linenums!, #depthwalk, #depthwalk_nodes, #error?, #evalable_inspect, #fixup_multiple_assignments!, #fixup_rescue_assignments!, #initialize_ivars, inline_symbols, #inspect, #lhs_unparse, #linerange, #lvalue, #lvars_defined_in, #merge_replacement_session, namelist, #negate, #original_brackets_assign, param_names, #parsetrees, #pretty_print, #prohibit_fixup, #replace_ivars_and_self, #replace_value, #rescue_parsetree, #to_parsetree, #to_parsetree_and_warnings, #unary, #walk, #xform_tree!
Methods included from Stackable::Meta
#build_exemplars, #enumerate_exemplars, #identity_param
Methods included from FlattenedIvars
#flattened_ivars, #flattened_ivars_equal?
Methods included from Stackable
Constructor Details
#initialize(first, middle, last = nil) ⇒ UndefNode
Returns a new instance of UndefNode.
4739 4740 4741 4742 4743 4744 4745 4746 4747 |
# File 'lib/redparse/node.rb', line 4739 def initialize(first,middle,last=nil) @offset=first.offset if last node,newsym=first,last super(*node << (newsym)) else super((middle)) end end |
Instance Method Details
#image ⇒ Object
4749 |
# File 'lib/redparse/node.rb', line 4749 def image; "(undef)" end |
#parsetree(o) ⇒ Object
4755 4756 4757 4758 4759 4760 4761 4762 |
# File 'lib/redparse/node.rb', line 4755 def parsetree(o) result=map{|name| [:undef, str2parsetree(name,o)] } if result.size==1 result.first else result.unshift :block end end |
#unparse(o = default_unparse_options) ⇒ Object
4751 4752 4753 |
# File 'lib/redparse/node.rb', line 4751 def unparse o= "undef #{map{|name| str_unparse name,o}.join(', ')}" end |