Reverted my 'do notation' fixes.

This commit is contained in:
Dominik Picheta 2013-01-20 17:34:43 +00:00
commit be51e8b61b
2 changed files with 13 additions and 10 deletions

View file

@ -494,6 +494,12 @@ proc primarySuffix(p: var TParser, r: PNode): PNode =
result = newNodeP(nkCall, p)
addSon(result, a)
exprColonEqExprListAux(p, nkExprEqExpr, tkParRi, tkEquals, result)
parseDoBlocks(p, result)
of tkDo:
var a = result
result = newNodeP(nkCall, p)
addSon(result, a)
parseDoBlocks(p, result)
of tkDot:
result = dotExpr(p, result)
result = parseGStrLit(p, result)
@ -730,7 +736,7 @@ proc parseProcExpr(p: var TParser, isExpr: bool): PNode =
proc isExprStart(p: TParser): bool =
case p.tok.tokType
of tkSymbol, tkAccent, tkOpr, tkNot, tkNil, tkCast, tkIf,
tkProc, tkDo, tkIterator, tkBind,
tkProc, tkIterator, tkBind,
tkParLe, tkBracketLe, tkCurlyLe, tkIntLit..tkCharLit, tkVar, tkRef, tkPtr,
tkTuple, tkObject, tkType, tkWhen, tkCase, tkShared:
result = true
@ -826,8 +832,6 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode =
getTok(p)
optInd(p, result)
addSon(result, primary(p, pmNormal))
of tkDo:
result = parseDoBlock(p)
else:
result = identOrLiteral(p)
if mode != pmSkipSuffix:
@ -860,7 +864,7 @@ proc parseExprStmt(p: var TParser): PNode =
optInd(p, a)
if p.tok.tokType == tkDo:
parseDoBlocks(p, call)
return call
return
result = if call.sonsLen <= 1: a
else: call
if p.tok.tokType == tkColon:

View file

@ -1,6 +1,5 @@
discard """
file: "tasynciossl.nim"
cmd: "nimrod cc --hints:on --define:ssl $# $#"
file: "tdomulttest.nim"
output: "555\ntest\nmulti lines\n99999999\nend"
"""
proc foo(bar, baz: proc (x: int): int) =