-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
feat(yaml): lexer that can lex very simple examples #3430
feat(yaml): lexer that can lex very simple examples #3430
Conversation
CodSpeed Performance ReportMerging #3430 will not alter performanceComparing Summary
|
9dff440
to
3e0cca2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSON lexer is old and it hasn't been refactored yet.
In the meantime, we created a proper infrastructure for creating a lexer, and this is documented in the CONTRIBUTING.md
file of the biome_parser
crate. It is possible to reach this document from the main CONTRIBUTING.md
, at the root of the repository.
The new infrastructure gives you many methods that you don't need to implement again, e.g. peek_byte
, consume_whitespace
Also, avoid unchecked methods whenever possible.
Yeah that's the document I was referencing when writing this. That, and looking at the json lexer. Is there anything more than the "Implement a lexer" section of that doc? It's a little sparse on info. |
3e0cca2
to
c7a1847
Compare
Unfortunately that part still lacks some documentation due to some recent refactors. I completely forgot to follow up and add more to it |
9885aa9
to
bf96f27
Compare
I suggest looking at the GraphQL parser and tokenizer. It's the most recent one |
@dyc3 any progress? 😅 |
I haven't had time recently, but I could try and get this merged this week. |
bf96f27
to
2462a59
Compare
2462a59
to
b143aed
Compare
Summary
I figured I'd take a stab at building the lexer based on the grammar in #3400. It's somewhat inspired by the json lexer. I'm posting it early here so people can see it, and avoid duplicated effort.
related to: #2365
Test Plan
Added some unit tests, and they all pass.