summary refs log tree commit diff stats
path: root/compiler/sem.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/sem.nim')
-rwxr-xr-xcompiler/sem.nim15
1 files changed, 13 insertions, 2 deletions
diff --git a/compiler/sem.nim b/compiler/sem.nim
index 391bf840c..cfdd936ad 100755
--- a/compiler/sem.nim
+++ b/compiler/sem.nim
@@ -14,7 +14,8 @@ import
   wordrecg, ropes, msgs, os, condsyms, idents, renderer, types, platform, math,
   magicsys, parser, nversion, nimsets, semfold, importer,
   procfind, lookups, rodread, pragmas, passes, semdata, semtypinst, sigmatch,
-  semthreads, intsets, transf, evals, idgen, aliases, cgmeth, lambdalifting
+  semthreads, intsets, transf, evals, idgen, aliases, cgmeth, lambdalifting,
+  evaltempl
 
 proc semPass*(): TPass
 # implementation
@@ -56,7 +57,17 @@ proc isTopLevel(c: PContext): bool {.inline.} =
 proc newSymS(kind: TSymKind, n: PNode, c: PContext): PSym = 
   result = newSym(kind, considerAcc(n), getCurrOwner())
   result.info = n.info
-  
+
+proc newSymG*(kind: TSymKind, n: PNode, c: PContext): PSym =
+  # like newSymS, but considers gensym'ed symbols
+  if n.kind == nkSym: 
+    result = n.sym
+    InternalAssert sfGenSym in result.flags
+    InternalAssert result.kind == kind
+  else:
+    result = newSym(kind, considerAcc(n), getCurrOwner())
+    result.info = n.info
+
 proc semIdentVis(c: PContext, kind: TSymKind, n: PNode,
                  allowed: TSymFlags): PSym
   # identifier with visability