From 6753d3685448eb2ba5760de0bcc842a887d09a84 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 4 Sep 2012 00:55:13 +0200 Subject: further improvements for term rewriting macros --- tests/patterns/tor.nim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/patterns/tor.nim (limited to 'tests/patterns/tor.nim') 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 -- cgit 1.4.1-2-gfad0