summary refs log tree commit diff stats
path: root/compiler/trees.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/trees.nim')
-rw-r--r--compiler/trees.nim8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/trees.nim b/compiler/trees.nim
index c4ddc8cf7..cc2b0eafd 100644
--- a/compiler/trees.nim
+++ b/compiler/trees.nim
@@ -144,10 +144,12 @@ proc whichPragma*(n: PNode): TSpecialWord =
   case key.kind
   of nkIdent: result = whichKeyword(key.ident)
   of nkSym: result = whichKeyword(key.sym.name)
-  of nkCast: result = wCast
+  of nkCast: return wCast
   of nkClosedSymChoice, nkOpenSymChoice:
-    result = whichPragma(key[0])
-  else: result = wInvalid
+    return whichPragma(key[0])
+  else: return wInvalid
+  if result in nonPragmaWordsLow..nonPragmaWordsHigh:
+    result = wInvalid
 
 proc isNoSideEffectPragma*(n: PNode): bool =
   var k = whichPragma(n)