diff options
author | Zahary Karadjov <zahary@gmail.com> | 2012-03-26 04:36:26 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2012-03-26 04:36:26 +0300 |
commit | 6216046bc6b2794d15705f5d2621f602bda636c4 (patch) | |
tree | 8a70def0c70dc634ee92d1144c4b12e661042343 /tests/compile | |
parent | bc2eb0ea9b8a806ddafdb7726c94363fbd2c2f20 (diff) | |
download | Nim-6216046bc6b2794d15705f5d2621f602bda636c4.tar.gz |
genSym support for hygienic macros and templates.
example: template hygienic(val: expr) = var `*x` = val echo `*x` *x was chosen as mnemonic for "opposite of public" and thus private
Diffstat (limited to 'tests/compile')
-rw-r--r-- | tests/compile/tgensym.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/compile/tgensym.nim b/tests/compile/tgensym.nim new file mode 100644 index 000000000..3c0405136 --- /dev/null +++ b/tests/compile/tgensym.nim @@ -0,0 +1,12 @@ +template hygienic(val: expr) = + var `*x` = val + stdout.write `*x` + +var x = 100 + +hygienic 1 +hygienic 2 +hygienic 3 + +echo x + |