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: remove the limit of 3 subsyntaxes depth #1186

Merged
merged 3 commits into from
Nov 3, 2022

Conversation

jgmdev
Copy link
Member

@jgmdev jgmdev commented Nov 3, 2022

Make the state a string of bytes instead of a 32bits integer to be able to have deeper subsyntax support. Fixes issues with syntax files like the one for PHP that was already hitting more than 3 subsyntaxes depth.

Make the state a string of bytes instead of a 32bits integer to be able
to have deeper subsyntax support. Fixes issues with syntax files like
the one for PHP that was already hitting more than 3 subsyntaxes depth.
@jgmdev jgmdev force-pushed the PR/tokenizer-state-as-bytes branch from 229b717 to 7f9d8cc Compare November 3, 2022 22:47
@adamharrison
Copy link
Member

This is excellent; to reiterate from discord: strings are pretty efficient in lua, so this should be no problem, and allows for us to have infinitely many levels of subsyntax. A fantastic rearchitecting; kudos @jgmdev .

@adamharrison adamharrison merged commit b8a4f72 into lite-xl:master Nov 3, 2022
takase1121 pushed a commit to takase1121/lite-xl that referenced this pull request Nov 14, 2022
* tokenizer: remove the limit of 3 subsyntaxes depth

Make the state a string of bytes instead of a 32bits integer to be able
to have deeper subsyntax support. Fixes issues with syntax files like
the one for PHP that was already hitting more than 3 subsyntaxes depth.

* remove unnecesary call to set_subsyntax_pattern_idx

* fixed wrong word on comments
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