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

chore(grit): improve snippet compiler #3223

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

arendjr
Copy link
Contributor

@arendjr arendjr commented Jun 16, 2024

Summary

Contains many updates to the bindings again, including a major change to align the bindings closer to the semantics expected by Grit. In short, this means that nodes in the Grit bindings can be either nodes or tokens in Biome terminology.

This helped me to make some significant progress on the snippet compiler, which has been heavily revisited in general. I have added a few internal tests which show that a Grit literal snippet with embedded JS content gets properly compiled to a Grit pattern with the nodes matching Biome's parsed CST.

This brings me again a step closer to matching patterns, since we now have a valid pattern to match against.

Test Plan

Added some tests.

@@ -237,262 +226,3 @@ impl PatternCompiler {
}
}
}

impl PatternCompiler {
pub(crate) fn from_snippet_node(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This method has been refactored and moved to snippet_compiler.rs, since that's where it's used anyway.

Copy link

codspeed-hq bot commented Jun 16, 2024

CodSpeed Performance Report

Merging #3223 will not alter performance

Comparing arendjr:better-snippet-compiler (d4de830) with main (e8c75e3)

Summary

✅ 90 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants