Hi everyone;

I am writing a macro which uses module:

@f module X
  x= 4
end

macro f(ex)
isa(ex,Expr) && (ex.head == :module) || error("@f : syntax error")
module_name = ex.args[2]
module_blk = ex.args[3].args
import_stmts =  quote
  import CSS.Leech
end
insert!(module_blk,length(module_blk),import_stmts)
esc(ex)
end

But it gives the error:
ERROR: syntax: malformed expression

What is wrong here?

Thanks

Reply via email to