summary refs log tree commit diff stats
path: root/compiler/pragmas.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-01-03 18:56:05 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-01-03 18:56:05 +0100
commitcb9110c43d4ae9c29a0a1e0d54f7735712d4ba62 (patch)
tree630e4ab6d76a8415beb7d8135ea9531179d99c78 /compiler/pragmas.nim
parent2ee2022c29ec4774eda51cb431052a9fc24982a7 (diff)
downloadNim-cb9110c43d4ae9c29a0a1e0d54f7735712d4ba62.tar.gz
--define:nimQuirky exception handling for Nim; in preparation of a blog post
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r--compiler/pragmas.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index 58f64f7b0..7db25a7d1 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -864,7 +864,9 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
         incl(sym.flags, sfSideEffect)
       of wNoreturn:
         noVal(c, it)
-        incl(sym.flags, sfNoReturn)
+        # Disable the 'noreturn' annotation when in the "Quirky Exceptions" mode!
+        if not isDefined(c.config, "nimQuirky"):
+          incl(sym.flags, sfNoReturn)
         if sym.typ[0] != nil:
           localError(c.config, sym.ast[paramsPos][0].info,
             ".noreturn with return type not allowed")
@@ -1119,7 +1121,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
         else: sym.flags.incl sfUsed
       of wLiftLocals: discard
       else: invalidPragma(c, it)
-    elif sym == nil or (sym != nil and sym.kind in {skVar, skLet, skParam, 
+    elif sym == nil or (sym != nil and sym.kind in {skVar, skLet, skParam,
                       skField, skProc, skFunc, skConverter, skMethod, skType}):
       n.sons[i] = semCustomPragma(c, it)
     elif sym != nil: