diff options
author | Araq <rumpf_a@web.de> | 2013-05-14 00:41:07 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-05-14 00:41:07 +0200 |
commit | 9b9a18094732ec88157a11d3845d626b8970bfb9 (patch) | |
tree | 54e47ed39c83c32224362e9bb73c18be9fdb95a9 /compiler/parser.nim | |
parent | 61b304832365d4d534628e002ac1e8620b19d94c (diff) | |
download | Nim-9b9a18094732ec88157a11d3845d626b8970bfb9.tar.gz |
'inject' for 'for' loop variables
Diffstat (limited to 'compiler/parser.nim')
-rw-r--r-- | compiler/parser.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim index e2167f460..7cfd35a41 100644 --- a/compiler/parser.nim +++ b/compiler/parser.nim @@ -817,7 +817,7 @@ proc parseTuple(p: var TParser, indentAllowed = false): PNode = if not sameInd(p): break proc parseParamList(p: var TParser, retColon = true): PNode = - #| paramList = '(' identColonEquals ^* (comma/semicolon) ')' + #| paramList = '(' declColonEquals ^* (comma/semicolon) ')' #| paramListArrow = paramList? ('->' optInd typeDesc)? #| paramListColon = paramList? (':' optInd typeDesc)? var a: PNode @@ -829,7 +829,7 @@ proc parseParamList(p: var TParser, retColon = true): PNode = while true: case p.tok.tokType of tkSymbol, tkAccent: - a = parseIdentColonEquals(p, {withBothOptional}) + a = parseIdentColonEquals(p, {withBothOptional, withPragma}) of tkParRi: break else: @@ -1278,15 +1278,15 @@ proc parseExceptBlock(p: var TParser, kind: TNodeKind): PNode = addSon(result, parseStmt(p)) proc parseFor(p: var TParser): PNode = - #| forStmt = 'for' symbol (comma symbol)* 'in' expr colcom stmt + #| forStmt = 'for' (identWithPragma ^+ comma) 'in' expr colcom stmt result = newNodeP(nkForStmt, p) getTokNoInd(p) - var a = parseSymbol(p) + var a = identWithPragma(p) addSon(result, a) while p.tok.tokType == tkComma: getTok(p) optInd(p, a) - a = parseSymbol(p) + a = identWithPragma(p) addSon(result, a) eat(p, tkIn) addSon(result, parseExpr(p)) |