further improvements for term rewriting macros

This commit is contained in:
Araq 2012-09-04 00:55:13 +02:00
commit 6753d36854
8 changed files with 74 additions and 28 deletions

9
tests/patterns/tor.nim Normal file
View file

@ -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