summary refs log tree commit diff stats
path: root/lib/std
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/effecttraits.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/std/effecttraits.nim b/lib/std/effecttraits.nim
index 635ec82d0..fb057a669 100644
--- a/lib/std/effecttraits.nim
+++ b/lib/std/effecttraits.nim
@@ -18,6 +18,7 @@ import macros
 
 proc getRaisesListImpl(n: NimNode): NimNode = discard "see compiler/vmops.nim"
 proc getTagsListImpl(n: NimNode): NimNode = discard "see compiler/vmops.nim"
+proc getForbidsListImpl(n: NimNode): NimNode = discard "see compiler/vmops.nim"
 proc isGcSafeImpl(n: NimNode): bool = discard "see compiler/vmops.nim"
 proc hasNoSideEffectsImpl(n: NimNode): bool = discard "see compiler/vmops.nim"
 
@@ -37,6 +38,14 @@ proc getTagsList*(fn: NimNode): NimNode =
   expectKind fn, nnkSym
   result = getTagsListImpl(fn)
 
+proc getForbidsList*(fn: NimNode): NimNode =
+  ## Extracts the `.forbids` list of the func/proc/etc `fn`.
+  ## `fn` has to be a resolved symbol of kind `nnkSym`. This
+  ## implies that the macro that calls this proc should accept `typed`
+  ## arguments and not `untyped` arguments.
+  expectKind fn, nnkSym
+  result = getForbidsListImpl(fn)
+
 proc isGcSafe*(fn: NimNode): bool =
   ## Return true if the func/proc/etc `fn` is `gcsafe`.
   ## `fn` has to be a resolved symbol of kind `nnkSym`. This