summary refs log tree commit diff stats
path: root/tests/parser/tletcolon.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parser/tletcolon.nim')
-rw-r--r--tests/parser/tletcolon.nim33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/parser/tletcolon.nim b/tests/parser/tletcolon.nim
new file mode 100644
index 000000000..ec7c24106
--- /dev/null
+++ b/tests/parser/tletcolon.nim
@@ -0,0 +1,33 @@
+discard """
+  output: '''boo
+3
+44 3
+more body code
+yes
+yes'''
+"""
+
+template x(body): untyped =
+  body
+  44
+
+template y(val, body): untyped =
+  body
+  val
+
+proc mana =
+  let foo = x:
+    echo "boo"
+  var foo2 = y 3:
+    echo "3"
+  echo foo, " ", foo2
+
+mana()
+let other = x:
+  echo "more body code"
+  if true:
+    echo "yes"
+  else:
+    echo "no"
+let outer = y(5):
+  echo "yes"