diff options
author | Jeff Ciesielski <jeffciesielski@gmail.com> | 2016-07-04 22:52:24 -0400 |
---|---|---|
committer | Jeff Ciesielski <jeffciesielski@gmail.com> | 2016-07-04 22:52:24 -0400 |
commit | 4f4aafda6c1cc13e1d8073e341344a49507e7174 (patch) | |
tree | 69fd10efcd60a50cecec0d5a1ca8ba4fe5051f96 /compiler | |
parent | 94d1aa5109ebe022e6e51c7cd84033e2457b184f (diff) | |
download | Nim-4f4aafda6c1cc13e1d8073e341344a49507e7174.tar.gz |
Plumb {.intdefine.} and {.strdefine.} pragmas.
Shorthand so that users won't need to use the .magic pragma
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/pragmas.nim | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index dc618d9aa..fffb69ca8 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -63,7 +63,8 @@ const wImportCpp, wImportObjC, wError, wNoInit, wCompileTime, wGlobal, wGensym, wInject, wCodegenDecl, wGuard, wGoto, wExportNims} constPragmas* = {wImportc, wExportc, wHeader, wDeprecated, wMagic, wNodecl, - wExtern, wImportCpp, wImportObjC, wError, wGensym, wInject, wExportNims} + wExtern, wImportCpp, wImportObjC, wError, wGensym, wInject, wExportNims, + wIntDefine, wStrDefine} letPragmas* = varPragmas procTypePragmas* = {FirstCallConv..LastCallConv, wVarargs, wNosideeffect, wThread, wRaises, wLocks, wTags, wGcSafe} @@ -898,6 +899,10 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, of wBase: noVal(it) sym.flags.incl sfBase + of wIntDefine: + sym.magic = mIntDefine + of wStrDefine: + sym.magic = mIntDefine else: invalidPragma(it) else: invalidPragma(it) |