diff options
author | Araq <rumpf_a@web.de> | 2011-11-27 19:01:55 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-11-27 19:01:55 +0100 |
commit | a489161b1629b2b7347521c8ec67a0e5e812ef6a (patch) | |
tree | eea6b32a8b598a613cdda006c9cbcfcedba7dccf /compiler/syntaxes.nim | |
parent | 7832af187afa60fee37ab6e598f822b6a6ba6025 (diff) | |
download | Nim-a489161b1629b2b7347521c8ec67a0e5e812ef6a.tar.gz |
compiler uses new 'readLine'
Diffstat (limited to 'compiler/syntaxes.nim')
-rwxr-xr-x | compiler/syntaxes.nim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/syntaxes.nim b/compiler/syntaxes.nim index 14f7d7f03..9d4658a0b 100755 --- a/compiler/syntaxes.nim +++ b/compiler/syntaxes.nim @@ -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 |