diff options
author | Araq <rumpf_a@web.de> | 2014-01-20 08:29:02 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-01-20 08:29:02 +0100 |
commit | 79f59d18f19e8ab2b6878e8ef27c583bdfc16e68 (patch) | |
tree | 54392ea10c2facd6acd67b3fb34a78c304026ba9 /tests | |
parent | 6fd008f23ed3c1e712ddd0fc0b158b979bdbbce2 (diff) | |
download | Nim-79f59d18f19e8ab2b6878e8ef27c583bdfc16e68.tar.gz |
command syntax is allowed in expressions
Diffstat (limited to 'tests')
-rw-r--r-- | tests/parser/tcommand_as_expr.nim | 12 | ||||
-rw-r--r-- | tests/patterns/tpatterns.nim (renamed from tests/pattern/tpatterns.nim) | 0 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/parser/tcommand_as_expr.nim b/tests/parser/tcommand_as_expr.nim new file mode 100644 index 000000000..f6868a2fc --- /dev/null +++ b/tests/parser/tcommand_as_expr.nim @@ -0,0 +1,12 @@ +discard """ + output: "12" +""" + +proc foo(x: int): int = x-1 +proc foo(x, y: int): int = x-y + +let x = foo 7.foo, # comment here + foo(1, foo 8) +# 12 = 6 - -6 +echo x + diff --git a/tests/pattern/tpatterns.nim b/tests/patterns/tpatterns.nim index 6bc8772e3..6bc8772e3 100644 --- a/tests/pattern/tpatterns.nim +++ b/tests/patterns/tpatterns.nim |