From 68b7ae26b312c7c9646097a5030cdc923a5eb66d Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 5 Jul 2019 22:12:06 +0200 Subject: [PATCH] fix tests --- compiler/scanner.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/scanner.v b/compiler/scanner.v index fbfd888802..fae0afa029 100644 --- a/compiler/scanner.v +++ b/compiler/scanner.v @@ -138,7 +138,7 @@ fn (s mut Scanner) skip_whitespace() { for s.pos < s.text.len && is_white(s.text[s.pos]) { if is_nl(s.text[s.pos]) { // Count \r\n as one line - if !(s.text[s.pos] == `\n` && s.text[s.pos-1] == `\r`) { + if !(s.text[s.pos] == `\n` && s.pos > 0 && s.text[s.pos-1] == `\r`) { s.line_nr++ } if s.is_fmt {