Added `global` pragma that can be used to introduce new global variables from within procs
This commit is contained in:
parent
8d698b2bdd
commit
6d80583d5a
6 changed files with 22 additions and 10 deletions
|
|
@ -51,7 +51,7 @@ const
|
|||
wImportcpp, wImportobjc, wError}
|
||||
varPragmas* = {wImportc, wExportc, wVolatile, wRegister, wThreadVar, wNodecl,
|
||||
wMagic, wHeader, wDeprecated, wCompilerProc, wDynLib, wExtern,
|
||||
wImportcpp, wImportobjc, wError, wNoInit, wCompileTime}
|
||||
wImportcpp, wImportobjc, wError, wNoInit, wCompileTime, wGlobal}
|
||||
constPragmas* = {wImportc, wExportc, wHeader, wDeprecated, wMagic, wNodecl,
|
||||
wExtern, wImportcpp, wImportobjc, wError}
|
||||
letPragmas* = varPragmas
|
||||
|
|
@ -494,6 +494,9 @@ proc pragma(c: PContext, sym: PSym, n: PNode, validPragmas: TSpecialWords) =
|
|||
noVal(it)
|
||||
incl(sym.flags, sfCompileTime)
|
||||
incl(sym.loc.Flags, lfNoDecl)
|
||||
of wGlobal:
|
||||
noVal(it)
|
||||
incl(sym.flags, sfGlobal)
|
||||
of wMerge:
|
||||
noval(it)
|
||||
incl(sym.flags, sfMerge)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue