Skip to content

Readability of lex.fsl - #17817

Merged
abonie merged 14 commits into
dotnet:mainfrom
Martin521:lexing-deobfuscation
Oct 10, 2024
Merged

Readability of lex.fsl#17817
abonie merged 14 commits into
dotnet:mainfrom
Martin521:lexing-deobfuscation

Conversation

@Martin521

@Martin521Martin521 commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

Description

I found reading and understanding lex.fsl not easy. To hopefully make it easier for future newcomers, I have tried to remove some hurdles.

This PR

  • renames some items to differentiate them from other items with the same name
  • removes the dysfunctional threading of a token through shouldStartLine
  • adds tests for the preprocessing directives (including one to guard the anywhite* "#if" ident_char+ rule of the lexer)
  • simplifies some code
  • adds a comment to explain the skip parameter
  • adds a comment to explain HASH_IDENT
  • intends not to change the lexing process and results in any way

I haven't tackled the big issues ;-)

Checklist

  • Test cases added

@Martin521
Martin521 requested a review from a team as a code ownerSeptember 30, 2024 09:17
@github-actions

github-actionsBot commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

Comment threadsrc/Compiler/lex.fsl
@Martin521
Martin521 marked this pull request as draft September 30, 2024 10:09
@Martin521
Martin521 marked this pull request as ready for review September 30, 2024 18:08
@Martin521

Copy link
Copy Markdown
ContributorAuthor

Can somebody add the NO_RELEASE_NOTES label?

@edgarfgpedgarfgp added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Oct 2, 2024
@Martin521
Martin521force-pushed the lexing-deobfuscation branch from 46794e5 to 905f4ccCompareOctober 9, 2024 13:58
@Martin521

Copy link
Copy Markdown
ContributorAuthor

This can be merged

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NO_RELEASE_NOTESLabel for pull requests which signals, that user opted-out of providing release notes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants

@Martin521@vzarytovskii@abonie@T-Gro@edgarfgp