Implement {.booldefine.} (#10533)

This commit is contained in:
Oscar Nihlgård 2019-02-03 09:06:00 +01:00 • committed by Andreas Rumpf
commit 0091f2ad3b
9 changed files with 71 additions and 17 deletions

View file

@ -67,7 +67,7 @@ const
wGensym, wInject, wCodegenDecl, wGuard, wGoto, wExportNims, wUsed}
constPragmas* = {wImportc, wExportc, wHeader, wDeprecated, wMagic, wNodecl,
wExtern, wImportCpp, wImportObjC, wError, wGensym, wInject, wExportNims,
wIntDefine, wStrDefine, wUsed, wCompilerProc, wCore}
wIntDefine, wStrDefine, wBoolDefine, wUsed, wCompilerProc, wCore}
letPragmas* = varPragmas
procTypePragmas* = {FirstCallConv..LastCallConv, wVarargs, wNosideeffect,
wThread, wRaises, wLocks, wTags, wGcSafe}
@ -1106,6 +1106,8 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
sym.magic = mIntDefine
of wStrDefine:
sym.magic = mStrDefine
of wBoolDefine:
sym.magic = mBoolDefine
of wUsed:
noVal(c, it)
if sym == nil: invalidPragma(c, it)