summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorJasper Jenkins <jasper.vs.jenkins@gmail.com>2019-05-05 11:45:53 -0700
committerJasper Jenkins <jasper.vs.jenkins@gmail.com>2019-05-05 11:45:53 -0700
commit1f207df7aef7dd469a998a4522891b25eab4c9df (patch)
treef6a682963e50b4b2d514d3972cb4fd79da490436 /compiler
parentd4167c3f8c813cbea7f6e4634cc577b4be14d253 (diff)
downloadNim-1f207df7aef7dd469a998a4522891b25eab4c9df.tar.gz
handle in semConst
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim1
-rw-r--r--compiler/jsgen.nim1
-rw-r--r--compiler/semstmts.nim3
3 files changed, 2 insertions, 3 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index be966671b..e03c4b1c1 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -2708,7 +2708,6 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
     inc p.splitDecls
     genGotoState(p, n)
   of nkBreakState: genBreakState(p, n, d)
-  of nkExprColonExpr: expr(p, n.sons[1], d)
   else: internalError(p.config, n.info, "expr(" & $n.kind & "); unknown node kind")
 
 proc genNamedConstExpr(p: BProc, n: PNode): Rope =
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index dc81b4e37..cd13aab78 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -2503,7 +2503,6 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
   of nkPragmaBlock: gen(p, n.lastSon, r)
   of nkComesFrom:
     discard "XXX to implement for better stack traces"
-  of nkExprColonExpr: gen(p, n.sons[1], r)
   else: internalError(p.config, n.info, "gen: unknown node type: " & $n.kind)
 
 proc newModule(g: ModuleGraph; module: PSym): BModule =
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index b8f35408f..a0a1caf7f 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -641,7 +641,8 @@ proc semConst(c: PContext, n: PNode): PNode =
         addSon(b, copyTree(def))
       else:
         setVarType(c, v, typ.sons[j])
-        v.ast = def[j]
+        v.ast = if def[j].kind != nkExprColonExpr: def[j]
+                else: def[j].sons[1]
         b.sons[j] = newSymNode(v)
     addSon(result,b)
   dec c.inStaticContext