summary refs log tree commit diff stats
path: root/compiler/trees.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/trees.nim')
-rwxr-xr-xcompiler/trees.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/trees.nim b/compiler/trees.nim
index 3b35b2ff6..f393bfc66 100755
--- a/compiler/trees.nim
+++ b/compiler/trees.nim
@@ -146,3 +146,7 @@ proc IsRange*(n: PNode): bool {.inline.} =
         n[0].kind == nkSymChoice and n[0][1].sym.name.id == ord(wDotDot):
       result = true
 
+proc whichPragma*(n: PNode): TSpecialWord = 
+  let key = if n.kind == nkExprColonExpr: n.sons[0] else: n
+  if key.kind == nkIdent: result = whichKeyword(key.ident)
+