summary refs log tree commit diff stats
path: root/compiler/pragmas.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-07-19 22:22:20 +0200
committerAraq <rumpf_a@web.de>2013-07-19 22:22:20 +0200
commitbfbdb1f028a4b3e67932d6467450e53762ecf633 (patch)
treece425f2c3706f077725b688da8a74010401241f6 /compiler/pragmas.nim
parent0c18e053365f767366fa17823796930b3458e2a5 (diff)
downloadNim-bfbdb1f028a4b3e67932d6467450e53762ecf633.tar.gz
refactorings for the eval engine; bugfix: clean templates as accessors
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r--compiler/pragmas.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index 8f3da9f38..bf4f25014 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -24,7 +24,7 @@ const
     wCompilerProc, wProcVar, wDeprecated, wVarargs, wCompileTime, wMerge, 
     wBorrow, wExtern, wImportCompilerProc, wThread, wImportCpp, wImportObjC,
     wNoStackFrame, wError, wDiscardable, wNoInit, wDestructor, wCodegenDecl,
-    wGenSym, wInject, wRaises, wTags}
+    wGenSym, wInject, wRaises, wTags, wOperator}
   converterPragmas* = procPragmas
   methodPragmas* = procPragmas
   templatePragmas* = {wImmediate, wDeprecated, wError, wGenSym, wInject, wDirty}
@@ -34,7 +34,7 @@ const
   iteratorPragmas* = {FirstCallConv..LastCallConv, wNosideEffect, wSideEffect, 
     wImportc, wExportc, wNodecl, wMagic, wDeprecated, wBorrow, wExtern,
     wImportcpp, wImportobjc, wError, wDiscardable, wGenSym, wInject, wRaises,
-    wTags}
+    wTags, wOperator}
   exprPragmas* = {wLine}
   stmtPragmas* = {wChecks, wObjChecks, wFieldChecks, wRangechecks,
     wBoundchecks, wOverflowchecks, wNilchecks, wAssertions, wWarnings, wHints,
@@ -717,6 +717,9 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int,
           if sym == nil: invalidPragma(it)
         of wLine: PragmaLine(c, it)
         of wRaises, wTags: pragmaRaisesOrTags(c, it)
+        of wOperator:
+          if sym == nil: invalidPragma(it)
+          else: sym.position = expectIntLit(c, it)
         else: invalidPragma(it)
       else: invalidPragma(it)
   else: processNote(c, it)