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

Tokenizer updates #317

Merged
merged 22 commits into from
Jun 2, 2023
Merged

Tokenizer updates #317

merged 22 commits into from
Jun 2, 2023

Conversation

duckdoom4
Copy link
Collaborator

@duckdoom4 duckdoom4 commented Jun 1, 2023

  • Split the atl patterns into it's own file
  • Auto generate token files from language files
  • Fixed a whole bunch of bugs in the tokenizer
  • Tokenizer code should be a bit more readable now
  • It's slower now, had to redo some parts to make it functional.
    • I already have some ideas on how to speed it up a lot, but needs some more work.
  • Had to add some temporary tokens for the python grammar file that should be changed later
  • Fixed custom color injection code. (Fixes this comment from @FaceCrap)

duckdoom4 added 16 commits June 1, 2023 17:35
Something is still causing the tokenizer to misalign when using the generated patterns. I'll try to fix it tomorrow
This is to match the behaviour of textmate, where the top most token is the last token added
This allows the end pattern of a range to extend based on the content pattern matches
Due to the way typescript initializes const object, we can't have circular references to patterns.
To fix that, we just push all external dependencies in a shared file after all other files have been loaded.
Remove use of \G as javascript's regex engine doesn't support it
Other fixes to make sure we can tokenize the python grammar file
Change some renpy keyword to display as control flow keywords
@duckdoom4 duckdoom4 force-pushed the update-custom-containers branch from 61d42d9 to a5f33cb Compare June 1, 2023 15:39
@duckdoom4
Copy link
Collaborator Author

duckdoom4 commented Jun 1, 2023

@LuqueDaniel Can we make it so this isn't checked on any *.g.ts files?

Code style issues found in 4 files. Forgot to run Prettier?

@LuqueDaniel
Copy link
Member

The workflow runs the format-check npm command. I guess it can be excluded via the Prettier configuration.

@duckdoom4
Copy link
Collaborator Author

The workflow runs the format-check npm command. I guess it can be excluded via the Prettier configuration.

Got it, fixed now :)

@LuqueDaniel LuqueDaniel added this to the 2.2.0 milestone Jun 1, 2023
LuqueDaniel
LuqueDaniel previously approved these changes Jun 2, 2023
Copy link
Member

@LuqueDaniel LuqueDaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

duckdoom4 added 2 commits June 2, 2023 13:02
Will add a special rule in our development area for displaying these in red
@duckdoom4 duckdoom4 merged commit 128155b into develop Jun 2, 2023
@duckdoom4 duckdoom4 deleted the update-custom-containers branch June 2, 2023 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants