Added std/effecttraits.nim (#15462)
This commit is contained in:
parent
aa1d7fe1e9
commit
1f4b9cebd4
4 changed files with 53 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue