Module UnifiedRuby
In: lib/unified_ruby.rb

Methods

Public Instance methods

rewrite_dasgn_curr(exp)

Alias for rewrite_dasgn

:defn is one of the most complex of all the ASTs in ruby. We do one of 3 different translations:

1) From:

  s(:defn, :name, s(:scope, s(:block, s(:args, ...), ...)))
  s(:defn, :name, s(:bmethod, s(:masgn, s(:dasgn_curr, :args)), s(:block, ...)))
  s(:defn, :name, s(:fbody, s(:bmethod, s(:masgn, s(:dasgn_curr, :splat)), s(:block, ...))))

to:

  s(:defn, :name, s(:args, ...), s(:scope, s:(block, ...)))

2) From:

  s(:defn, :writer=, s(:attrset, :@name))

to:

  s(:defn, :writer=, s(:args), s(:attrset, :@name))

3) From:

  s(:defn, :reader, s(:ivar, :@name))

to:

  s(:defn, :reader, s(:args), s(:ivar, :@name))
rewrite_flip3(exp)

Alias for rewrite_flip2

[Validate]