Skip to content

Commit

Permalink
now working with current versions of Ruby2Ruby and SexpProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
jhellerstein committed Sep 3, 2017
1 parent 468fedc commit 691f9f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions lib/bud/rewrite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def call_to_id(exp)
# converting ASTs to strings with doing analysis on ASTs. Those should be
# split into two separate passes.
def process_iter(exp)
# first field of exp is tag; shift it
exp.shift
iter = process exp.shift
args = exp.shift

Expand Down Expand Up @@ -129,7 +131,7 @@ def do_process_iter(iter, args, body)
end

def process_call(exp)
recv, op, *args = exp
tag, recv, op, *args = exp
if OP_LIST.include?(op) and @context[1] == :defn and @context.length == 2
# NB: context.length is 2 when see a method call at the top-level of a
# :defn block -- this is where we expect Bloom statements to appear
Expand Down Expand Up @@ -257,7 +259,7 @@ def record_rule(lhs, op, rhs_pos, rhs, unsafe_funcs_called)
end

def do_rule(exp)
lhs, op, rhs_ast = exp
tag, lhs, op, rhs_ast = exp
lhs = process(lhs)

rhs_ast = MapRewriter.new.process(rhs_ast)
Expand Down Expand Up @@ -380,7 +382,7 @@ def process_call(exp)
def process_iter(exp)
tag, recv, iter_args, body = exp
if (iter_args == 0)
iter_args = [:args]
iter_args = s(:args)
end
new_body = push_and_process(body)
return s(tag, process(recv), process(iter_args), new_body)
Expand Down Expand Up @@ -422,7 +424,7 @@ def process_iter(exp)
tag, recv, iter_args, body = exp
new_body = push_and_process(body)
if (iter_args == 0)
iter_args = [:args]
iter_args = s(:args)
end
return s(tag, process(recv), process(iter_args), new_body)
end
Expand Down
4 changes: 2 additions & 2 deletions test/tc_collections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class BendTypesDelete
end

bootstrap do
t1 << [5, nil]
t1 << [[5, nil]]
t1 << [5, 10]
end

Expand All @@ -422,7 +422,7 @@ def test_types_delete
p.run_bg
p.sync_do {
assert_equal(2, p.t1.length)
p.t2 <+ [[5, 100]]
p.t2 <+ [[[5, nil], nil]]
}
p.sync_do
p.sync_do {
Expand Down

0 comments on commit 691f9f4

Please sign in to comment.