summary refs log tree commit diff stats
path: root/tests/accept/compile/ttempl3.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-05-01 20:11:55 +0200
committerAraq <rumpf_a@web.de>2011-05-01 20:11:55 +0200
commit6ff8752be53b7c0ad2c01615fdf1ab1bb619fb83 (patch)
tree6ad172b70b3b54063bc0dd6566a6c4ed0f5b0a99 /tests/accept/compile/ttempl3.nim
parent0d75723f919931c8523715dbd537d6f86d8ac3dd (diff)
downloadNim-6ff8752be53b7c0ad2c01615fdf1ab1bb619fb83.tar.gz
cleaned up the tests; fixes #30; fixes #26
Diffstat (limited to 'tests/accept/compile/ttempl3.nim')
-rwxr-xr-xtests/accept/compile/ttempl3.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/accept/compile/ttempl3.nim b/tests/accept/compile/ttempl3.nim
index 0c8fa9a94..7b2c70f79 100755
--- a/tests/accept/compile/ttempl3.nim
+++ b/tests/accept/compile/ttempl3.nim
@@ -24,3 +24,19 @@ var
 ha = 1  
 echo(ha)
 
+
+# Test identifier generation:
+template prefix(name: expr): expr = `"hu" name`
+
+var `hu "XYZ"` = "yay"
+
+echo prefix(XYZ)
+
+template typedef(name: expr, typ: typeDesc) = 
+  type
+    `T name`* = typ
+    `P name`* = ref `T name`
+    
+typedef(myint, int)
+var x: PMyInt
+