parent
c6fadb1799
commit
562dde624f
2 changed files with 6 additions and 3 deletions
|
|
@ -303,11 +303,14 @@ proc registerAdditionalOps*(c: PCtx) =
|
||||||
|
|
||||||
proc getEffectList(c: PCtx; a: VmArgs; effectIndex: int) =
|
proc getEffectList(c: PCtx; a: VmArgs; effectIndex: int) =
|
||||||
let fn = getNode(a, 0)
|
let fn = getNode(a, 0)
|
||||||
|
var list = newNodeI(nkBracket, fn.info)
|
||||||
if fn.typ != nil and fn.typ.n != nil and fn.typ.n[0].len >= effectListLen and
|
if fn.typ != nil and fn.typ.n != nil and fn.typ.n[0].len >= effectListLen and
|
||||||
fn.typ.n[0][effectIndex] != nil:
|
fn.typ.n[0][effectIndex] != nil:
|
||||||
var list = newNodeI(nkBracket, fn.info)
|
|
||||||
for e in fn.typ.n[0][effectIndex]:
|
for e in fn.typ.n[0][effectIndex]:
|
||||||
list.add opMapTypeInstToAst(c.cache, e.typ.skipTypes({tyRef}), e.info, c.idgen)
|
list.add opMapTypeInstToAst(c.cache, e.typ.skipTypes({tyRef}), e.info, c.idgen)
|
||||||
|
else:
|
||||||
|
list.add newIdentNode(getIdent(c.cache, "UncomputedEffects"), fn.info)
|
||||||
|
|
||||||
setResult(a, list)
|
setResult(a, list)
|
||||||
|
|
||||||
registerCallback c, "stdlib.effecttraits.getRaisesListImpl", proc (a: VmArgs) =
|
registerCallback c, "stdlib.effecttraits.getRaisesListImpl", proc (a: VmArgs) =
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
## for Nim's macro system.
|
## for Nim's macro system.
|
||||||
## **Since**: Version 1.4.
|
## **Since**: Version 1.4.
|
||||||
##
|
##
|
||||||
## One can test for the existance of this standard module
|
## One can test for the existence of this standard module
|
||||||
## via `defined(nimHasEffectTraitsModule)`.
|
## via `defined(nimHasEffectTraitsModule)`.
|
||||||
|
|
||||||
import macros
|
import macros
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue