mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-29 02:33:58 +00:00
fixes long standing parsing issue with command syntax
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
discard """
|
||||
output: '''140
|
||||
5-120-120
|
||||
359'''
|
||||
359
|
||||
77'''
|
||||
"""
|
||||
#import math
|
||||
|
||||
@@ -16,8 +17,10 @@ proc foo(x, y: int): int = x-y
|
||||
let x = optarg foo 7.foo
|
||||
let y = singlearg foo(1, foo 8)
|
||||
let z = singlearg 1.foo foo 8
|
||||
|
||||
|
||||
echo x, y, z
|
||||
|
||||
let a = [2,4,8].map do (d:int) -> int: d + 1
|
||||
echo a[0], a[1], a[2]
|
||||
echo a[0], a[1], a[2]
|
||||
|
||||
echo(foo 8, foo 8)
|
||||
|
||||
@@ -17,3 +17,10 @@ echo(type(10).name()) # doesn't work
|
||||
|
||||
echo(name(type(10))) # works
|
||||
echo((type(10)).name()) # works
|
||||
|
||||
|
||||
# test that 'addr' still works
|
||||
proc poo(x, y: ptr int) = discard
|
||||
|
||||
var someInt: int
|
||||
poo(addr someInt, addr someInt)
|
||||
|
||||
Reference in New Issue
Block a user