Skip to content

Commit

Permalink
bring back explicit &block
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed May 26, 2013
1 parent 665035e commit c2dde4a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/subaltern/evaluator.rb
Expand Up @@ -228,7 +228,9 @@ def new_context(parent_context, call_args)
else
args.send(shift)
con[name] =
if type == :optarg && cargs.empty?
if type == :blockarg
parent_context['block']
elsif type == :optarg && cargs.empty?
Subaltern.eval_tree(parent_context, @optargs[name])
else
cargs.send(shift)
Expand Down Expand Up @@ -263,7 +265,12 @@ def initialize(context, tree)
@tree = tree
end

def call(context, args)
def call(*args)

do_call(@conext, args)
end

def do_call(context, args)

# TODO: bind args

Expand Down Expand Up @@ -543,7 +550,7 @@ def self.eval_yield(context, tree)

args = tree.children.collect { |t| eval_tree(context, t) }

block.call(context, args)
block.do_call(context, args)
end

# def self.eval_evstr(context, tree)
Expand Down

0 comments on commit c2dde4a

Please sign in to comment.