Class: RedParse::NotMatchNode
- Defined in:
- lib/redparse/node.rb,
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
-
#initialize(left, op, right = nil) ⇒ NotMatchNode
constructor
A new instance of NotMatchNode.
- #op ⇒ Object
- #parsetree(o) ⇒ Object
- #reducer_ident ⇒ Object
Methods inherited from OpNode
Methods inherited from RawOpNode
Methods inherited from ValueNode
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, #error?, #evalable_inspect, #fixup_multiple_assignments!, #fixup_rescue_assignments!, #force_stmt_list_rip, #image, #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, #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
Constructor Details
#initialize(left, op, right = nil) ⇒ NotMatchNode
Returns a new instance of NotMatchNode.
1464 1465 1466 1467 |
# File 'lib/redparse/node.rb', line 1464 def initialize(left,op,right=nil) op,right=nil,op unless right replace [left,right] end |
Instance Method Details
#op ⇒ Object
1481 |
# File 'lib/redparse/node.rb', line 1481 def op; "!~"; end |
#parsetree(o) ⇒ Object
1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 |
# File 'lib/redparse/node.rb', line 1469 def parsetree(o) if StringNode===left and left.char=="/" [:not, [:match2, left.parsetree(o), right.parsetree(o)]] elsif StringNode===right and right.char=="/" [:not, [:match3, right.parsetree(o), left.parsetree(o)]] else result=opnode_parsetree(o) result[2]="=#{op[1..1]}".to_sym result=[:not, result] end end |
#reducer_ident ⇒ Object
17330 17331 17332 |
# File 'lib/redparse/ReduceWithsFor_RedParse_1_9.rb', line 17330 def reducer_ident :NotMatchNode end |