-
Notifications
You must be signed in to change notification settings - Fork 49
Implement instructions for matching builtin character classes and assertions #547
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3b6b676
Copy over new ascii bitset
rctcwyvrn 33caa79
Add matchBuiltin
rctcwyvrn 139daa5
Remove debug prints
rctcwyvrn 9abf4af
Remove bitset fast path
rctcwyvrn 286f5d8
Fully remove remnants of the bitset fast path
rctcwyvrn 9e915cd
Merge branch 'main' into speedy-builtins
rctcwyvrn e593ddb
Completely replace AssertionFunction with regexAssert(by:)
rctcwyvrn 25dc277
Merge branch 'main' into speedy-builtins
rctcwyvrn 3e38ac6
Cleanup
rctcwyvrn e5d8b4a
Move match builtin and assert + Add AssertionPayload
rctcwyvrn 0466c25
Cleanup assertions
rctcwyvrn 87078ad
Merge branch 'main' into speedy-builtins
rctcwyvrn f401e84
Fix tests
rctcwyvrn b09f45f
Update opcode description for assertBy
rctcwyvrn c581ea2
Merge branch 'main' into speedy-builtins
rctcwyvrn 2a82231
Merge branch 'main' into speedy-builtins
rctcwyvrn fb1576a
Update branch to match main
rctcwyvrn 3b9485e
Use the newly cleaned up _CharacterClassModel
rctcwyvrn 64d1ed9
Add characterClass DSLTree node
rctcwyvrn 2a6fe3c
Bugfixes
rctcwyvrn 206bfc6
Add documentation for matchBuiltin
rctcwyvrn b53f524
Lots of cleanup
rctcwyvrn bb5245f
Move assertion payload
rctcwyvrn 0746847
More minor cleanup
rctcwyvrn c718543
Perform boundary check for .anyScalar when in grapheme mode
rctcwyvrn d35b578
Merge branch 'main' into speedy-builtins
rctcwyvrn ca8acf2
Merge branch 'main' into speedy-builtins
rctcwyvrn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future: get rid of all these consumers except custom ones like custom character classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason why all these consumer functions +
_CharacterClassModel.matches
still exist is because we have to emit any non-ascii CustomCharacterClass as one big consumer so it needs to know how to create a consumer for each possible member type (which includes Atom).Do you think we could emit it as an ordered choice over its members instead? I think the main thing to add would be instructions for handling the custom character class set operations, and if we had that then we could rip out all of the non character property related stuff in ConsumerInterface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to avoid emitting backtracking traffic for custom character classes if we can. However, since there's a compilation boundary around each member anyways, that might not account for much. Let's keep this for now and try to come back to it again
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing to consider is that if we keep non-ascii custom character classes as one big consumer we're unable to access any optimized matching for any of its members.
Also just no longer having all the matching logic exactly duplicated across
ConsumerInterface
andProcessor
seems like something pretty important for future extensibility/preventing bugs. We pay some cost for emitting backtracking traffic but this is mostly for uncommon cases, the most common ascii cases are already handled by the bitset.