-
-
Save samdmarshall/7cb67d131893c87683a2d6581390c18b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hint: used config file '/usr/local/Cellar/nim/0.17.0/nim/config/nim.cfg' [Conf] | |
Hint: used config file '/Users/Samantha/.config/nim.cfg' [Conf] | |
Hint: system [Processing] | |
Hint: demo [Processing] | |
Hint: macros [Processing] | |
demo.nim(7, 6) Warning: a [b] will be parsed as command syntax; spacing is deprecated [Deprecated] | |
StmtList(CurlyExpr(Ident(!"foo"), Ident(!"bar"))) | |
clang -c -w -I/usr/local/Cellar/nim/0.17.0/nim/lib -o /Users/Samantha/Projects/snippets/nim-macros/nimcache/demo.o /Users/Samantha/Projects/snippets/nim-macros/nimcache/demo.c | |
Hint: clang -o /Users/Samantha/Projects/snippets/nim-macros/demo /Users/Samantha/Projects/snippets/nim-macros/nimcache/demo.o /Users/Samantha/Projects/snippets/nim-macros/nimcache/stdlib_system.o /Users/Samantha/Projects/snippets/nim-macros/nimcache/stdlib_macros.o -ldl [Exec] | |
Hint: operation successful (11852 lines compiled; 0.335 sec total; 17.938MiB peakmem; Debug Build) [SuccessX] | |
[GC] total memory: 18808832 | |
[GC] occupied memory: 18010112 | |
[GC] stack scans: 802 | |
[GC] stack cells: 1868 | |
[GC] cycle collections: 0 | |
[GC] max threshold: 0 | |
[GC] zct capacity: 1024 | |
[GC] max cycle table size: 0 | |
[GC] max pause time [ms]: 0 | |
[GC] max stack size: 48112 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import macros | |
macro dsl(body: untyped): untyped = | |
echo lispRepr(body) | |
dsl: | |
foo { | |
bar | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My expectation is that the returned
lispRepr
would beStmtList(Ident(!"foo"), CurlyExpr(Ident(!"bar")))
, but instead comes out asStmtList(CurlyExpr(Ident(!"foo"), Ident(!"bar")))
.