Skip to content
Snippets Groups Projects
Commit 71b18cb3 authored by Daniel Olsson's avatar Daniel Olsson
Browse files

Macro works now but does not give correct line number

parent 1be6d216
No related branches found
No related tags found
No related merge requests found
......@@ -2,11 +2,13 @@ macro doWhile(block, cond)
println("__source__ ", __source__)
println("cond ", cond)
println("block ", block)
res = quote
error("TODO: Your code here")
res = quote
#error("TODO: Your code here")
$(esc(block))
while $(esc(cond))
$(esc(block))
end
end
println(res) # Should not print any lines referencing dowhile.jl
res
......
......@@ -30,7 +30,7 @@ end
m = Base.methods(Problem1.f, [Int])
Base.delete_method(m.ms[1])
@assert 2 == Problem1.f(1)
println(Problem1.f(1))
# TODO: Make an until block for Julia, similar to do {} while (cond); in C
#
# Make sure that any assertions and error-messages refer to lines in the original code.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment