Extend lexer for SimplicityHL formatter - #372
Open
ikripaka wants to merge 3 commits into
Open
Conversation
ikripaka
force-pushed
the
feat/fmt-parser
branch
2 times, most recently
from
July 23, 2026 17:45
3e6427e to
0cd4ac0
Compare
ikripaka
marked this pull request as ready for review
July 24, 2026 09:15
ikripaka
force-pushed
the
feat/fmt-parser
branch
from
July 29, 2026 09:47
f4a7091 to
1516be3
Compare
* add `fmt` feature * edit logic of lexer to include other characters (restrict behaviour to be consistent across different lexers) * add FmtTokens, which stores comments, newlines and whitespaces data * add `#[non_exhaustive]` to Token, TriviaKind and FmtToken * separate tests with modules for different behaviour (lexer + parser) * add additional spans for appropriate structs in parser * add integration test for lossless lexer, which checks that lossless lexer didn't lose anything from context (relies onto the all .simf examples in this repo)
ikripaka
force-pushed
the
feat/fmt-parser
branch
3 times, most recently
from
August 5, 2026 11:40
b8b59e9 to
de15ca1
Compare
* add tests to test such behaviour * separate digits parsers, reject digits with leading undersrores in decimal variant * process whitespace in lexer by chunks instead of one-by-one * featuregate logic with including underscores
ikripaka
force-pushed
the
feat/fmt-parser
branch
from
August 5, 2026 12:13
de15ca1 to
da16f18
Compare
Collaborator
|
Let's flatten the nested test modules in Current: mod tests {
mod lexer { ... }
mod fmt_lexer { ... }
}Proposed: mod lexer { ... }
mod fmt_lexer { ... }UPD: Same idea in |
LesterEvSe
approved these changes
Aug 5, 2026
LesterEvSe
left a comment
Collaborator
There was a problem hiding this comment.
ACK 11c8937; tested locally with just check and just check_fuzz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add parsing of additional tokens for formatting
fmtfeature to separate logic for formatter parsingFmtTokens, which stores comments, newlines and whitespace dataToken,TriviaKind,FmtTokenas non-exhaustive