I suspect the parser thinks you're creating a hash. What if you use quote do ... end?
The issue tracker is at code.google.com/p/mirah
-- Sent from my phone
# test.mirah
macro def foo
quote do
$javax.annotation.Generated
def bar
end
end
end
# Results
Parsing...
test.mirah
Exception in thread "main" mirah/impl/Mirah.mirah:4443:in `do_block':
jmeta.SyntaxError: expected statement before ' $javax.anno' (at line:
3, char: 1) (NativeException)
from mirah/impl/Mirah.mirah:4389:in `brace_block'
from mirah/impl/Mirah.mirah:3558:in `primary2_id'
from mirah/impl/Mirah.mirah:2359:in `primary2'
from mirah/impl/Mirah.mirah:1757:in `primary'
from mirah/impl/Mirah.mirah:7105:in `lhs2'
from mirah/impl/Mirah.mirah:7068:in `lhs'
from mirah/impl/Mirah.mirah:1061:in `statement2'
from mirah/impl/Mirah.mirah:681:in `statement'
No difference if it's macro def or defmacro.
~~ Robert.
~~ Robert.
# test.mirah
macro def foo
quote do
import javax.annotation.Generated
$Generated
def bar
end
end
end
Thanks for helping me sort this out!
~~ Robert.