only 1 argument allowed for command expressions

This commit is contained in:
Araq 2014-02-02 00:00:56 +01:00
commit 70eff919cd

View file

@ -672,12 +672,14 @@ proc primarySuffix(p: var TParser, r: PNode): PNode =
let a = result let a = result
result = newNodeP(nkCommand, p) result = newNodeP(nkCommand, p)
addSon(result, a) addSon(result, a)
while p.tok.tokType != tkEof: addSon result, parseExpr(p)
let a = parseExpr(p) when false:
addSon(result, a) while p.tok.tokType != tkEof:
if p.tok.tokType != tkComma: break let a = parseExpr(p)
getTok(p) addSon(result, a)
optInd(p, a) if p.tok.tokType != tkComma: break
getTok(p)
optInd(p, a)
if p.tok.tokType == tkDo: if p.tok.tokType == tkDo:
parseDoBlocks(p, result) parseDoBlocks(p, result)
else: else:
@ -1103,7 +1105,9 @@ proc parseExprStmt(p: var TParser): PNode =
#| doBlocks #| doBlocks
#| / macroColon #| / macroColon
#| ))? #| ))?
inc p.inPragma
var a = simpleExpr(p) var a = simpleExpr(p)
dec p.inPragma
if p.tok.tokType == tkEquals: if p.tok.tokType == tkEquals:
getTok(p) getTok(p)
optInd(p, result) optInd(p, result)