Implement named capture group.#175
Draft
hhugo wants to merge 12 commits intoocaml-community:masterfrom
Draft
Conversation
This commit does not include any optimization whatsoever. It includes many new tests that will change as we implement optimizations.
Tags on self-loops that also appear on all entering transitions are removed from those transitions and emitted as Set_prev on exit transitions. The runtime set_mem_prev records pos-1 (position before the consumed char), turning O(n) tag writes in loops into O(1) on exit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tags with identical occurrence signatures (same presence in init_tags and same set of transitions) are coalesced to share a single memory cell. The PPX remaps Tag references through the compiler's tag_map after compilation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Non-interfering cells from different rules share the same physical memory slot. Uses forward-reachability analysis and greedy graph coloring: cells conflict if they belong to the same rule, span multiple rules, or have overlapping forward-reachable state sets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This work was produce with the help of the Claude AI assistant.
Draft , as I plan to split it in 6 smaller PRs, starting with #174, I plan to review and understand implementations before opening individual PRs.
Here is the plan:
A chain of 5 PRs that implement efficient named pattern.
I believe the feature is usable with 1 + 2 already, as I expect constant offsets to be the most common.
Replace #112
Fix #5, #102