summary refs log tree commit diff stats
path: root/tests/patterns/tor.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-09-04 00:55:13 +0200
committerAraq <rumpf_a@web.de>2012-09-04 00:55:13 +0200
commit6753d3685448eb2ba5760de0bcc842a887d09a84 (patch)
treec4689853edb97b78dbff6edb337735a873e6bb97 /tests/patterns/tor.nim
parentb4cd119800c96361ff74ab804002c32d303233fc (diff)
downloadNim-6753d3685448eb2ba5760de0bcc842a887d09a84.tar.gz
further improvements for term rewriting macros
Diffstat (limited to 'tests/patterns/tor.nim')
-rw-r--r--tests/patterns/tor.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/patterns/tor.nim b/tests/patterns/tor.nim
new file mode 100644
index 000000000..304e1c692
--- /dev/null
+++ b/tests/patterns/tor.nim
@@ -0,0 +1,9 @@
+discard """
+  output: "110"
+"""
+
+template arithOps: expr = (`+` | `-` | `*`)
+template testOr{ (arithOps{f})(a, b) }(a, b, f: expr): expr = f(a+1, b)
+
+let xx = 10
+echo 10*xx