Skip to content

Extend lexer for SimplicityHL formatter - #372

Open
ikripaka wants to merge 13 commits into
BlockstreamResearch:masterfrom
ikripaka:feat/fmt-parser
Open

Extend lexer for SimplicityHL formatter#372
ikripaka wants to merge 13 commits into
BlockstreamResearch:masterfrom
ikripaka:feat/fmt-parser

Conversation

@ikripaka

@ikripaka ikripaka commented Jul 15, 2026

Copy link
Copy Markdown

Add parsing of additional tokens for formatting

  • add fmt feature to separate logic for formatter parsing
  • edit the logic of the lexer to include other characters as well for formatting
  • add FmtTokens, which stores comments, newlines and whitespace data
  • mark Token, TriviaKind, FmtToken as non-exhaustive
  • modify parser to ignore comments in regular mode
  • separate tests into modules
  • add span to most of the structs in the ast
  • add tests to test correctness of both behaviours for ordinary parsing and lossless

ikripaka added 2 commits July 23, 2026 16:52
* edit logic of lexer to include other characters as well for formatting
* add FmtTokens, which stores comments, newlines and whitespaces data
* mark Token as non-exhaustive
* modify parser to ignore comments in regular mode
* separate tests with modules
@ikripaka
ikripaka marked this pull request as ready for review July 24, 2026 09:15
@ikripaka
ikripaka requested a review from delta1 as a code owner July 24, 2026 09:15
ikripaka added 8 commits July 24, 2026 12:44
 * the logic of parsing has to be consistent across all parsers
* fix problem with recognizing keywords in a comments, while we don't have to recognize them
* add test for lossless lexer, which checks that lossless lexer didn't lose anything from context
* align tests with changes
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

Successfully merging this pull request may close these issues.

1 participant