1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
macro Tag = (tag, code`ClassDecl) -> className = code\match "^class%s+(%w+)" return type: "text" before: tag == "before" code: "-- #{tag}:#{className}" $[Tag("before")] class B getTag: => "before" $[Tag("after")] class C getTag: => "after" return B!\getTag!, C!\getTag!