Module: UnifiedRuby

Module | UnifiedRuby
In: | lib/unified_ruby.rb

### Methods

process rewrite_argscat rewrite_argspush rewrite_attrasgn rewrite_begin rewrite_block_pass rewrite_bmethod rewrite_call rewrite_dasgn rewrite_dasgn_curr rewrite_defn rewrite_defs rewrite_dmethod rewrite_dvar rewrite_fcall rewrite_masgn rewrite_op_asgn1 rewrite_resbody rewrite_rescue rewrite_splat rewrite_super rewrite_vcall rewrite_yield rewrite_zarray

### Public Instance methods

process(exp)
rewrite_argscat(exp)
rewrite_argspush(exp)
rewrite_attrasgn(exp)
rewrite_begin(exp)
rewrite_block_pass(exp)
rewrite_bmethod(exp)
rewrite_call(exp)
rewrite_dasgn(exp)
rewrite_dasgn_curr(exp)

Alias for rewrite_dasgn

rewrite_defn(exp)

: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_defs(exp)
rewrite_dmethod(exp)
rewrite_dvar(exp)
rewrite_fcall(exp)
rewrite_masgn(exp)
rewrite_op_asgn1(exp)
rewrite_resbody(exp)
rewrite_rescue(exp)
rewrite_splat(exp)
rewrite_super(exp)
rewrite_vcall(exp)
rewrite_yield(exp)
rewrite_zarray(exp)

[Validate]