From 6ff8752be53b7c0ad2c01615fdf1ab1bb619fb83 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 1 May 2011 20:11:55 +0200 Subject: cleaned up the tests; fixes #30; fixes #26 --- tests/accept/compile/ttempl3.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/accept/compile/ttempl3.nim') 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 + -- cgit 1.4.1-2-gfad0