make 'koch temp' work again
This commit is contained in:
parent
9db369063c
commit
44c12d9d20
2 changed files with 20 additions and 13 deletions
|
|
@ -2244,8 +2244,11 @@ 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:
|
||||||
let n = spawn.wrapProcForSpawn(p.module.g.graph, p.module.module, e, e.typ, nil, nil)
|
when defined(leanCompiler):
|
||||||
expr(p, n, d)
|
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)
|
||||||
|
expr(p, n, d)
|
||||||
of mParallel:
|
of mParallel:
|
||||||
when defined(leanCompiler):
|
when defined(leanCompiler):
|
||||||
quit "compiler built without support for the 'parallel' statement"
|
quit "compiler built without support for the 'parallel' statement"
|
||||||
|
|
|
||||||
|
|
@ -2163,18 +2163,22 @@ 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:
|
||||||
result = setMs(n, s)
|
when defined(leanCompiler):
|
||||||
for i in 1 ..< n.len:
|
localError(c.config, n.info, "compiler was built without 'spawn' support")
|
||||||
result.sons[i] = semExpr(c, n.sons[i])
|
result = n
|
||||||
let typ = result[^1].typ
|
|
||||||
if not typ.isEmptyType:
|
|
||||||
if spawnResult(typ, c.inParallelStmt > 0) == srFlowVar:
|
|
||||||
result.typ = createFlowVar(c, typ, n.info)
|
|
||||||
else:
|
|
||||||
result.typ = typ
|
|
||||||
result.add instantiateCreateFlowVarCall(c, typ, n.info).newSymNode
|
|
||||||
else:
|
else:
|
||||||
result.add c.graph.emptyNode
|
result = setMs(n, s)
|
||||||
|
for i in 1 ..< n.len:
|
||||||
|
result.sons[i] = semExpr(c, n.sons[i])
|
||||||
|
let typ = result[^1].typ
|
||||||
|
if not typ.isEmptyType:
|
||||||
|
if spawnResult(typ, c.inParallelStmt > 0) == srFlowVar:
|
||||||
|
result.typ = createFlowVar(c, typ, n.info)
|
||||||
|
else:
|
||||||
|
result.typ = typ
|
||||||
|
result.add instantiateCreateFlowVarCall(c, typ, n.info).newSymNode
|
||||||
|
else:
|
||||||
|
result.add c.graph.emptyNode
|
||||||
of mProcCall:
|
of mProcCall:
|
||||||
result = setMs(n, s)
|
result = setMs(n, s)
|
||||||
result.sons[1] = semExpr(c, n.sons[1])
|
result.sons[1] = semExpr(c, n.sons[1])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue