Added `global` pragma that can be used to introduce new global variables from within procs

This commit is contained in:
Zahary Karadjov 2012-04-05 19:20:52 +03:00
commit 6d80583d5a
6 changed files with 22 additions and 10 deletions

View file

@ -58,7 +58,7 @@ type
wWatchPoint, wSubsChar,
wAcyclic, wShallow, wUnroll, wLinearScanEnd,
wWrite, wPutEnv, wPrependEnv, wAppendEnv, wThreadVar, wEmit, wNoStackFrame,
wImplicitStatic
wImplicitStatic, wGlobal
TSpecialWords* = set[TSpecialWord]
@ -107,7 +107,7 @@ const
"watchpoint",
"subschar", "acyclic", "shallow", "unroll", "linearscanend",
"write", "putenv", "prependenv", "appendenv", "threadvar", "emit",
"nostackframe", "implicitstatic"]
"nostackframe", "implicitstatic", "global"]
proc findStr*(a: openarray[string], s: string): int =
for i in countup(low(a), high(a)):