first steps to make templates hygienic

This commit is contained in:
Araq 2012-08-20 01:13:13 +02:00
commit 5e15dec175
23 changed files with 486 additions and 187 deletions

View file

@ -62,12 +62,15 @@ proc extractSpec(filename: string): string =
#echo "warning: file does not contain spec: " & filename
result = ""
when not defined(nimhygiene):
{.pragma: inject.}
template parseSpecAux(fillResult: stmt) =
var ss = newStringStream(extractSpec(filename))
var p: TCfgParser
var p {.inject.}: TCfgParser
open(p, ss, filename, 1)
while true:
var e = next(p)
var e {.inject.} = next(p)
case e.kind
of cfgEof: break
of cfgSectionStart, cfgOption, cfgError: