diff --git a/julia/dowhile.jl b/julia/dowhile.jl index 00afddef2247d763e95c1763893675111d533f65..e4df3f5850019da6ee767465b9547d48657a848f 100644 --- a/julia/dowhile.jl +++ b/julia/dowhile.jl @@ -1,3 +1,25 @@ +function adjustLines(res, macrofile, invokedFile, invokedLine ) + sz =size(res.args) + dump(res) + temp = copy(res) + for i=1:sz[1] + if isa(temp.args[i], LineNumberNode) + if (String(temp.args[i].file) == macrofile) + file = temp.args[i].line = invokedLine + end + + #println(i) + #println(res.args[i].file) + else + #println(i) + #println("Nej") + end + #println(i) + #println(res.args[i].args) + end + return res +end + macro doWhile(block, cond) # println("__source__ ", __source__) #println("cond ", cond) @@ -11,7 +33,8 @@ macro doWhile(block, cond) $(esc(block)) end end - #print(__source__.line) - #println(res) # Should not print any lines referencing dowhile.jl + res = adjustLines(res,@__FILE__(), __source__.file, __source__.line) + println("Here is the whole") + println(res) # Should not print any lines referencing dowhile.jl res end