mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
inline function
This commit is contained in:
parent
d26f6f600f
commit
d9977b73aa
1 changed files with 30 additions and 1 deletions
|
@ -326,7 +326,36 @@ fn eat_line_comment<'a>(
|
|||
}
|
||||
state = state.advance_newline();
|
||||
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,
|
||||
};
|
||||
}
|
||||
b'\r' => {
|
||||
state = state.advance_newline();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue