Class: Macro::OneLineParenedNode

Inherits:
ParenedNode
  • Object
show all
Defined in:
lib/macro/ReduceWithsFor_RedParse_RedParse__MacroMixin_RedParse__WithMacros_1_9.rb,
lib/macro/ReduceWithsFor_RedParse_RedParse__MacroMixin_RedParse__WithMacros_1_8.rb,
lib/macro.rb

Instance Method Summary collapse

Instance Method Details

#reducer_identObject



19098
19099
19100
# File 'lib/macro/ReduceWithsFor_RedParse_RedParse__MacroMixin_RedParse__WithMacros_1_9.rb', line 19098

def reducer_ident
  :OneLineParenedNode
end

#unparse(o = default_unparse_options) ⇒ Object

hacky way to get unparser to not emit newlines in most cases I think this isn’t necessary now that forms (and subnodes) have their linenums zeroed on creation



810
811
812
813
814
815
816
817
# File 'lib/macro.rb', line 810

def unparse(o=default_unparse_options)
  old_linenum=o[:linenum]
  o[:linenum]=2**128
  result=super(o)
  diff=o[:linenum]-2**128
  o[:linenum]=old_linenum+diff
  return result
end