diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-10-02 17:22:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-02 17:22:31 +0200 |
commit | 1f4b9cebd4a073024f68e70156be1d8ceab7344f (patch) | |
tree | 0f5b1aee181de324ce2fcdb33f185f61f76ad891 /compiler/vmops.nim | |
parent | aa1d7fe1e9d9c63691b46d7d1c4c37e2c814bfc5 (diff) | |
download | Nim-1f4b9cebd4a073024f68e70156be1d8ceab7344f.tar.gz |
Added std/effecttraits.nim (#15462)
Diffstat (limited to 'compiler/vmops.nim')
-rw-r--r-- | compiler/vmops.nim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/vmops.nim b/compiler/vmops.nim index 298a02bb6..de6229ec7 100644 --- a/compiler/vmops.nim +++ b/compiler/vmops.nim @@ -261,3 +261,12 @@ proc registerAdditionalOps*(c: PCtx) = a.setResult osproc.execCmdEx(getString(a, 0), options).toLit registerCallback c, "stdlib.times.getTime", proc (a: VmArgs) {.nimcall.} = setResult(a, times.getTime().toLit) + + registerCallback c, "stdlib.effecttraits.getRaisesListImpl", proc (a: VmArgs) = + let fn = getNode(a, 0) + if fn.typ != nil and fn.typ.n != nil and fn.typ.n[0].len >= effectListLen and + fn.typ.n[0][exceptionEffects] != nil: + var list = newNodeI(nkBracket, fn.info) + for e in fn.typ.n[0][exceptionEffects]: + list.add opMapTypeInstToAst(c.cache, e.typ.skipTypes({tyRef}), e.info) + setResult(a, list) |