toml: fix comment ends with crlf (#13097)

pull/13102/head
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
1 changed files with 1 additions and 1 deletions

View File

@ -341,12 +341,12 @@ fn (mut s Scanner) ignore_line() ?string {
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, ' ignoring until EOL...')
start := s.pos
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"')
if s.at_crlf() {
util.printdbg(@MOD + '.' + @STRUCT + '.' + @FN, 'letting `\\r\\n` slip through')
break
}
s.next()
}
return s.text[start..s.pos]
}