Fix re/pat.t test failures: empty pattern reuse, /o modifier caching, pos() reset#279
Merged
Fix re/pat.t test failures: empty pattern reuse, /o modifier caching, pos() reset#279
Conversation
Implement RuntimePosLvalue.invalidatePos() to set pos() to undef when a string is modified. When $_ .= "" is executed, the pos() value should be reset because the string content has changed. This fixes test 237 in re/pat.t. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
- Add empty pattern handling to matchRegexDirect (reuses lastSuccessfulPattern) - Implement /o modifier caching per callsite with QUOTE_REGEX_O opcode - Add callsite ID allocation in bytecode compiler and JVM emitter - Updates both interpreter and JVM backends This fixes tests 198-201, 203, and 207 in re/pat.t, bringing pass count to 239/239. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
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.
Summary
pos()reset when string is modified with.=operator//reuse (uses last successful pattern)/omodifier caching per callsite with newQUOTE_REGEX_OopcodeDetails
pos() reset (test 237)
RuntimePosLvalue.invalidatePos()methodpos()to undef after.=Empty pattern reuse (tests 198-201, 203)
matchRegexDirect- reuseslastSuccessfulPattern//matches using the last successfully compiled regex pattern/o modifier caching (test 207)
/omodifier caching per callsiteQUOTE_REGEX_Oopcode with callsite ID parameter/ocaching/ocompiles the pattern only once at first executionTest Results
re/pat.t: 239/239 tests pass (was 233/239)op/bop.t: 488/522 tests pass (same as master - no regression)Generated with Devin