Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix whitespace lexing #37

Open
jprochazk opened this issue Jul 8, 2023 · 0 comments
Open

fix whitespace lexing #37

jprochazk opened this issue Jul 8, 2023 · 0 comments

Comments

@jprochazk
Copy link
Owner

#[doc(hidden)]
#[regex(r"(\r?\n)+[ ]*", priority = 10)]
_Tok_Indent,
#[doc(hidden)]
#[regex(r"[ \n\r]+")]
_Tok_Whitespace,

you can see that if a newline is prefixed by a space character, it will become the _Tok_Whitespace token instead of _Tok_Indentation, and _Tok_Whitespace is discarded:

Ok(TokenKind::_Tok_Whitespace | TokenKind::_Tok_Comment) => continue,

i feel like it should Just Work ™️ if we remove _Tok_Whitespace and add space to the first character set in the _Tok_Indentation regex

@jprochazk jprochazk added 🚧‏‏‎ WIP In progress and removed 🚧‏‏‎ WIP In progress labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant