make 'koch temp' work again

This commit is contained in:
Araq 2019-07-14 16:07:30 +02:00
commit 44c12d9d20
2 changed files with 20 additions and 13 deletions

View file

@ -2244,6 +2244,9 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
of mNLen..mNError, mSlurp..mQuoteAst: of mNLen..mNError, mSlurp..mQuoteAst:
localError(p.config, e.info, strutils.`%`(errXMustBeCompileTime, e.sons[0].sym.name.s)) localError(p.config, e.info, strutils.`%`(errXMustBeCompileTime, e.sons[0].sym.name.s))
of mSpawn: of mSpawn:
when defined(leanCompiler):
quit "compiler built without support for the 'spawn' statement"
else:
let n = spawn.wrapProcForSpawn(p.module.g.graph, p.module.module, e, e.typ, nil, nil) let n = spawn.wrapProcForSpawn(p.module.g.graph, p.module.module, e, e.typ, nil, nil)
expr(p, n, d) expr(p, n, d)
of mParallel: of mParallel:

View file

@ -2163,6 +2163,10 @@ proc semMagic(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode =
result.sons[1] = semStmt(c, x, {}) result.sons[1] = semStmt(c, x, {})
dec c.inParallelStmt dec c.inParallelStmt
of mSpawn: of mSpawn:
when defined(leanCompiler):
localError(c.config, n.info, "compiler was built without 'spawn' support")
result = n
else:
result = setMs(n, s) result = setMs(n, s)
for i in 1 ..< n.len: for i in 1 ..< n.len:
result.sons[i] = semExpr(c, n.sons[i]) result.sons[i] = semExpr(c, n.sons[i])