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

[PHP] Optimize embedded CSS/JS syntax definitions #4060

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

deathaxe
Copy link
Collaborator

This PR makes sure to pop CSS/JS contexts off stack, if quotation mark is matched by customizing relevant CSS/JS contexts only.

By not injecting required lookahead into each context via prototype, compiled syntax cache size is reduced by round about 200kB as more contexts share same patterns.

Modified syntax definitions are designed for being included into inline event and style attributes of HTML tags.

Note: This commit does not change behavior, just saves some RAM.

This commit makes sure to pop CSS/JS contexts off stack,
if quotation mark is matched by customizing relevant CSS/JS contexts only.

By not injecting required lookahead into each context via `prototype`,
compiled syntax cache size is reduced by round about 200kB as more contexts
share same patterns.

Modified syntax definitions are designed for being included into inline event
and style attributes of HTML tags.

Note: This commit does not change behavior, just saves some RAM.
@deathaxe deathaxe merged commit 76069dc into sublimehq:master Oct 21, 2024
1 check passed
@deathaxe deathaxe deleted the pr/php/optimize-embedded-css-js branch October 21, 2024 05:24
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.

3 participants