mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-23 07:45:23 +00:00
command syntax is allowed in expressions
This commit is contained in:
12
tests/parser/tcommand_as_expr.nim
Normal file
12
tests/parser/tcommand_as_expr.nim
Normal file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user