compiler uses new 'readLine'

This commit is contained in:
Araq 2011-11-27 19:01:55 +01:00
commit a489161b16
8 changed files with 86 additions and 73 deletions

View file

@ -89,12 +89,13 @@ proc parsePipe(filename: string, inputStream: PLLStream): PNode =
result = ast.emptyNode
var s = LLStreamOpen(filename, fmRead)
if s != nil:
var line = LLStreamReadLine(s)
var line = newStringOfCap(80)
discard LLStreamReadLine(s, line)
var i = UTF8_Bom(line)
if containsShebang(line, i):
line = LLStreamReadLine(s)
if containsShebang(line, i):
discard LLStreamReadLine(s, line)
i = 0
if (line[i] == '#') and (line[i + 1] == '!'):
if line[i] == '#' and line[i+1] == '!':
inc(i, 2)
while line[i] in WhiteSpace: inc(i)
var q: TParser