summary refs log tree commit diff stats
path: root/compiler/semdata.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semdata.nim')
-rw-r--r--compiler/semdata.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim
index 921e87d30..f876770c0 100644
--- a/compiler/semdata.nim
+++ b/compiler/semdata.nim
@@ -312,3 +312,8 @@ proc checkSonsLen*(n: PNode, length: int) =
 proc checkMinSonsLen*(n: PNode, length: int) = 
   if sonsLen(n) < length: illFormedAst(n)
 
+proc isTopLevel*(c: PContext): bool {.inline.} = 
+  result = c.currentScope.depthLevel <= 2
+
+proc experimentalMode*(c: PContext): bool {.inline.} =
+  result = gExperimentalMode or sfExperimental in c.module.flags