1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

toml: fix comment ends with crlf (#13097)

This commit is contained in:
Ekopalypse 2022-01-08 18:16:32 +01:00 committed by GitHub
parent 70bf200e16
commit 64028eedb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,12 +341,12 @@ fn (mut s Scanner) ignore_line() ?string {
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, ' ignoring until EOL...') util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, ' ignoring until EOL...')
start := s.pos start := s.pos
for c := s.at(); c != scanner.end_of_text && c != `\n`; c = s.at() { for c := s.at(); c != scanner.end_of_text && c != `\n`; c = s.at() {
s.next()
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'skipping "${byte(c).ascii_str()} / $c"') util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'skipping "${byte(c).ascii_str()} / $c"')
if s.at_crlf() { if s.at_crlf() {
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'letting `\\r\\n` slip through') util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'letting `\\r\\n` slip through')
break break
} }
s.next()
} }
return s.text[start..s.pos] return s.text[start..s.pos]
} }