Class: Opal::Rewriters::MlhsArgs::MlhsRewriter

Inherits:
Base
  • Object
show all
Defined in:
lib/opal/rewriters/mlhs_args.rb

Constant Summary

Constants inherited from Base

Base::DUMMY_LOCATION

Instance Attribute Summary

Attributes inherited from Base

#current_node

Instance Method Summary collapse

Methods inherited from Base

#append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

Instance Method Details

#on_arg(node) ⇒ Object



113
114
115
# File 'lib/opal/rewriters/mlhs_args.rb', line 113

def on_arg(node)
  node.updated(:lvasgn)
end

#on_restarg(node) ⇒ Object



117
118
119
120
121
122
123
124
# File 'lib/opal/rewriters/mlhs_args.rb', line 117

def on_restarg(node)
  name = node.children[0]
  if name
    s(:splat, node.updated(:lvasgn))
  else
    s(:splat)
  end
end