Class: RedParse::MisparsedNode

Inherits:
ValueNode show all
Includes:
ErrorNode
Defined in:
lib/redparse/node.rb,
lib/redparse/ReduceWithsFor_RedParse_1_9.rb,
lib/redparse/ReduceWithsFor_RedParse_1_8.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

Methods inherited from ValueNode

#lvalue, #reducer_method

Methods inherited from Node

#+, #+@, #==, [], #[]=, #add_parent_links!, #args_rip, #begin_parsetree, #classic_inspect, create, #data, #deep_copy, #delete_extraneous_ivars!, #delete_linenums!, #depthwalk, #depthwalk_nodes, #evalable_inspect, #fixup_multiple_assignments!, #fixup_rescue_assignments!, #force_stmt_list_rip, #initialize, #initialize_ivars, inline_symbols, #inspect, #lhs_unparse, #linerange, #lvalue, #lvars_defined_in, #merge_replacement_session, namelist, #negate, #original_brackets_assign, param_names, #parsetree, #parsetrees, #pretty_print, #prohibit_fixup, #replace_ivars_and_self, #replace_value, #rescue_parsetree, #rfind, #rfind_all, #rgrep, #rip_and_rescues, #rip_explode!, #short_inspect, #stmts_rip, #to_parsetree, #to_parsetree_and_warnings, #to_ruby, #to_s, #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

#identity_name

Constructor Details

This class inherits a constructor from RedParse::Node

Instance Method Details

#blameObject

pass the buck to child ErrorNodes until there’s no one else



5401
5402
5403
5404
5405
5406
# File 'lib/redparse/node.rb', line 5401

def blame
  middle.each{|node| 
    node.respond_to? :blame and return node.blame 
  }
  return self
end

#error?(x = nil) ⇒ Boolean Also known as: msg

Returns:

  • (Boolean)


5408
5409
5410
5411
5412
# File 'lib/redparse/node.rb', line 5408

def error? x=nil
  @endline||=nil
  inner=middle.grep(MisparsedNode).first and return inner.error?( x )
  "#@endline: misparsed #{what}: #{middle.map{|node| node&&(node.short_inspect rescue node.inspect)}.join}" 
end

#imageObject



5398
# File 'lib/redparse/node.rb', line 5398

def image; "misparsed #{what}" end

#reducer_identObject



17510
17511
17512
# File 'lib/redparse/ReduceWithsFor_RedParse_1_9.rb', line 17510

def reducer_ident
  :MisparsedNode
end