handle in semConst
This commit is contained in:
parent
d4167c3f8c
commit
1f207df7ae
3 changed files with 2 additions and 3 deletions
|
|
@ -2708,7 +2708,6 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
|
||||||
inc p.splitDecls
|
inc p.splitDecls
|
||||||
genGotoState(p, n)
|
genGotoState(p, n)
|
||||||
of nkBreakState: genBreakState(p, n, d)
|
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")
|
else: internalError(p.config, n.info, "expr(" & $n.kind & "); unknown node kind")
|
||||||
|
|
||||||
proc genNamedConstExpr(p: BProc, n: PNode): Rope =
|
proc genNamedConstExpr(p: BProc, n: PNode): Rope =
|
||||||
|
|
|
||||||
|
|
@ -2503,7 +2503,6 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
of nkPragmaBlock: gen(p, n.lastSon, r)
|
of nkPragmaBlock: gen(p, n.lastSon, r)
|
||||||
of nkComesFrom:
|
of nkComesFrom:
|
||||||
discard "XXX to implement for better stack traces"
|
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)
|
else: internalError(p.config, n.info, "gen: unknown node type: " & $n.kind)
|
||||||
|
|
||||||
proc newModule(g: ModuleGraph; module: PSym): BModule =
|
proc newModule(g: ModuleGraph; module: PSym): BModule =
|
||||||
|
|
|
||||||
|
|
@ -641,7 +641,8 @@ proc semConst(c: PContext, n: PNode): PNode =
|
||||||
addSon(b, copyTree(def))
|
addSon(b, copyTree(def))
|
||||||
else:
|
else:
|
||||||
setVarType(c, v, typ.sons[j])
|
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)
|
b.sons[j] = newSymNode(v)
|
||||||
addSon(result,b)
|
addSon(result,b)
|
||||||
dec c.inStaticContext
|
dec c.inStaticContext
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue