From ef36a9dc3d0cce83442fda8c8d50738c470ca5c3 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 5 Mar 2016 14:37:11 +0100 Subject: [PATCH] fixes #3924 --- compiler/filter_tmpl.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/filter_tmpl.nim b/compiler/filter_tmpl.nim index 21810adb93..9e123e3a19 100644 --- a/compiler/filter_tmpl.nim +++ b/compiler/filter_tmpl.nim @@ -67,7 +67,7 @@ proc parseLine(p: var TTmplParser) = keyw: string j = 0 while p.x[j] == ' ': inc(j) - if p.x[0] == p.nimDirective and p.x[1] in {'?', '!'}: + if p.x[0] == p.nimDirective and p.x[1] == '?': newLine(p) elif p.x[j] == p.nimDirective: newLine(p) @@ -213,6 +213,9 @@ proc filterTmpl(stdin: PLLStream, filename: string, call: PNode): PLLStream = p.conc = strArg(call, "conc", 4, " & ") p.toStr = strArg(call, "tostring", 5, "$") p.x = newStringOfCap(120) + # do not process the first line which contains the directive: + if llStreamReadLine(p.inp, p.x): + p.info.line = p.info.line + int16(1) while llStreamReadLine(p.inp, p.x): p.info.line = p.info.line + int16(1) parseLine(p)