using statement (ala C#) implemented as macro (added as test).

simplified the usage of the interpolatedFragments iterator.
This commit is contained in:
Zahary Karadjov 2011-09-11 21:43:12 +03:00
commit 9acfc43119
5 changed files with 152 additions and 49 deletions

View file

@ -1381,6 +1381,7 @@ proc parseString(s: string, filename: string = "", line: int = 0): PNode =
var parser : TParser
OpenParser(parser, filename, stream)
result = parser.parseAll
CloseParser(parser)

View file

@ -903,7 +903,7 @@ proc semExpandMacroToAst(c: PContext, n: PNode, flags: TExprFlags): PNode =
var s = qualifiedLookup(c, macroCall.sons[0], {checkUndeclared})
if s == nil:
GlobalError(n.info, errUndeclaredIdentifier, macroCall.sons[0].strVal)
GlobalError(n.info, errUndeclaredIdentifier, macroCall.sons[0].renderTree)
var expanded : Pnode