summary refs log tree commit diff stats
path: root/compiler/pragmas.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-12-16 22:26:17 +0100
committerAraq <rumpf_a@web.de>2013-12-16 22:26:17 +0100
commit132b6b3efee8d1be7f94545ed5fefaf64de741dc (patch)
treecc2a24dd33eadc48a621d12e89294ecd451710c9 /compiler/pragmas.nim
parent01661daf76daa713d25d06d202f83c842a6f1fe3 (diff)
downloadNim-132b6b3efee8d1be7f94545ed5fefaf64de741dc.tar.gz
implemented 'injectStmt'; more debug support
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r--compiler/pragmas.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index 8c2425de3..6f1e7af25 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -43,7 +43,8 @@ const
     wFatal, wDefine, wUndef, wCompile, wLink, wLinkSys, wPure, wPush, wPop,
     wBreakpoint, wWatchpoint, wPassL, wPassC, wDeadCodeElim, wDeprecated,
     wFloatChecks, wInfChecks, wNanChecks, wPragma, wEmit, wUnroll,
-    wLinearScanEnd, wPatterns, wEffects, wNoForward, wComputedGoto}
+    wLinearScanEnd, wPatterns, wEffects, wNoForward, wComputedGoto,
+    wInjectStmt}
   lambdaPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl, 
     wNosideEffect, wSideEffect, wNoreturn, wDynLib, wHeader, 
     wDeprecated, wExtern, wThread, wImportcpp, wImportobjc, wNoStackFrame,
@@ -722,6 +723,11 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int,
         of wOperator:
           if sym == nil: invalidPragma(it)
           else: sym.position = expectIntLit(c, it)
+        of wInjectStmt:
+          if it.kind != nkExprColonExpr:
+            localError(it.info, errExprExpected)
+          else: 
+            it.sons[1] = c.semExpr(c, it.sons[1])
         else: invalidPragma(it)
       else: invalidPragma(it)
   else: processNote(c, it)