another inline

This commit is contained in:
Folkert 2022-05-14 23:51:06 +02:00
parent 9f2906a2f8
commit 2e3a8befc9
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -291,7 +291,36 @@ fn eat_line_comment<'a>(
comments_and_newlines.push(CommentOrNewline::DocComment("")); comments_and_newlines.push(CommentOrNewline::DocComment(""));
multiline = true; multiline = true;
return eat_spaces(state, multiline, comments_and_newlines);
for c in state.bytes() {
match c {
b' ' => {
state = state.advance(1);
}
b'\n' => {
state = state.advance_newline();
multiline = true;
comments_and_newlines.push(CommentOrNewline::Newline);
}
b'\r' => {
state = state.advance_newline();
}
b'\t' => {
return HasTab(state);
}
b'#' => {
state = state.advance(1);
return eat_line_comment(state, multiline, comments_and_newlines);
}
_ => break,
}
}
return Good {
state,
multiline,
comments_and_newlines,
};
} }
None => { None => {
// consume the second # // consume the second #