summary refs log tree commit diff stats
path: root/compiler/renderer.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-09-24 09:36:31 +0200
committerAraq <rumpf_a@web.de>2013-09-24 09:36:31 +0200
commit83584bf88934c45ce10e770ee15d070a09f88f45 (patch)
treec681f943c2f4ba6348eb8f5208c4a577ff183acd /compiler/renderer.nim
parent367abca3825fcd2f2a7fdf2bd699986f0535e6b1 (diff)
downloadNim-83584bf88934c45ce10e770ee15d070a09f88f45.tar.gz
implemented 'import a as b'
Diffstat (limited to 'compiler/renderer.nim')
-rw-r--r--compiler/renderer.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim
index efa4ecaba..f6fb0f8c0 100644
--- a/compiler/renderer.nim
+++ b/compiler/renderer.nim
@@ -448,6 +448,7 @@ proc lsub(n: PNode): int =
   of nkPragma: result = lcomma(n) + 4
   of nkCommentStmt: result = len(n.comment)
   of nkOfBranch: result = lcomma(n, 0, - 2) + lsub(lastSon(n)) + len("of_:_")
+  of nkImportAs: result = lsub(n.sons[0]) + len("_as_") + lsub(n.sons[1])
   of nkElifBranch: result = lsons(n) + len("elif_:_")
   of nkElse: result = lsub(n.sons[0]) + len("else:_")
   of nkFinally: result = lsub(n.sons[0]) + len("finally:_")
@@ -1191,6 +1192,11 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
     putWithSpace(g, tkColon, ":")
     gcoms(g)
     gstmts(g, lastSon(n), c)
+  of nkImportAs:
+    gsub(g, n.sons[0])
+    put(g, tkSpaces, Space)
+    putWithSpace(g, tkAs, "as")
+    gsub(g, n.sons[1])
   of nkBindStmt: 
     putWithSpace(g, tkBind, "bind")
     gcomma(g, n, c)