class MIKU::Macro

Public Class Methods

new(args, list) click to toggle source
# File core/miku/macro.rb, line 6
def initialize(args, list)
  @args = args
  @list = list
end

Public Instance Methods

inspect() click to toggle source
# File core/miku/macro.rb, line 21
def inspect
  "<macro #{@args.inspect} #{@list.inspect}>"
end
macro_expand(*args) click to toggle source
# File core/miku/macro.rb, line 11
def macro_expand(*args)
  if not(args.is_a? StaticCode) and args.car.is_a?(StaticCode)
    args.extend(StaticCode).staticcode_copy_info(args.car.staticcode_dump) end
  scope = MIKU::SymbolTable.new.miracle_binding(@args, args)
  # @args.zip(args){ |k, v|
  #   scope[k] = [v] }
  @list.inject(nil){ |last, operator|
    scope[:last] = last
    miku(operator, scope) } end