summary refs log tree commit diff stats
path: root/compiler/jsgen.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/jsgen.nim')
-rw-r--r--compiler/jsgen.nim13
1 files changed, 7 insertions, 6 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index dfe498e47..4772aecb5 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -1,6 +1,6 @@
 #
 #
-#           The Nimrod Compiler
+#           The Nim Compiler
 #        (c) Copyright 2014 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
@@ -71,8 +71,8 @@ type
   TGlobals = object 
     typeInfo, code: PRope
     forwarded: seq[PSym]
-    generatedSyms: TIntSet
-    typeInfoGenerated: TIntSet
+    generatedSyms: IntSet
+    typeInfoGenerated: IntSet
 
   PGlobals = ref TGlobals
   PProc = ref TProc
@@ -724,7 +724,7 @@ proc genBlock(p: PProc, n: PNode, r: var TCompRes) =
     if (n.sons[0].kind != nkSym): internalError(n.info, "genBlock")
     var sym = n.sons[0].sym
     sym.loc.k = locOther
-    sym.loc.a = idx
+    sym.position = idx+1
   setLen(p.blocks, idx + 1)
   p.blocks[idx].id = - p.unique # negative because it isn't used yet
   let labl = p.unique
@@ -741,7 +741,7 @@ proc genBreakStmt(p: PProc, n: PNode) =
     assert(n.sons[0].kind == nkSym)
     let sym = n.sons[0].sym
     assert(sym.loc.k == locOther)
-    idx = sym.loc.a
+    idx = sym.position-1
   else:
     # an unnamed 'break' can only break a loop after 'transf' pass:
     idx = len(p.blocks) - 1
@@ -1654,6 +1654,7 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
       r.res = nil
   of nkGotoState, nkState:
     internalError(n.info, "first class iterators not implemented")
+  of nkPragmaBlock: gen(p, n.lastSon, r)
   else: internalError(n.info, "gen: unknown node type: " & $n.kind)
   
 var globals: PGlobals
@@ -1664,7 +1665,7 @@ proc newModule(module: PSym): BModule =
   if globals == nil: globals = newGlobals()
   
 proc genHeader(): PRope =
-  result = ropef("/* Generated by the Nimrod Compiler v$1 */$n" &
+  result = ropef("/* Generated by the Nim Compiler v$1 */$n" &
                  "/*   (c) 2014 Andreas Rumpf */$n$n" & 
                  "$nvar Globals = this;$n" &
                  "var framePtr = null;$n" &