summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.comy>2011-09-11 21:43:12 +0300
committerZahary Karadjov <zahary@gmail.comy>2011-09-20 14:13:45 +0300
commit9acfc43119d42d7265497fd6ae60eda3903d9938 (patch)
treee9d729a2080c5bca1b45c979865977e43babb3f5 /compiler
parentdbcca9b3b994e3339c9a03c3846b7162147679fd (diff)
downloadNim-9acfc43119d42d7265497fd6ae60eda3903d9938.tar.gz
using statement (ala C#) implemented as macro (added as test).
simplified the usage of the interpolatedFragments iterator.
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/parser.nim3
-rwxr-xr-xcompiler/semexprs.nim2
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index c371e09cb..df21c9916 100755
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -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)
   
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index af4d4b6bc..6dbbba7b8 100755
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -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