Skip to content

Topic/look around#175

Merged
SimY4 merged 8 commits intomainfrom
topic/look-around
Sep 1, 2025
Merged

Topic/look around#175
SimY4 merged 8 commits intomainfrom
topic/look-around

Conversation

@SimY4
Copy link
Owner

@SimY4 SimY4 commented Aug 27, 2025

First implementation for positive/negative look-ahead/look-behind patterns is finally at review stage.

Fixes #34

@codecov-commenter
Copy link

codecov-commenter commented Aug 27, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 63.56589% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.68%. Comparing base (319d406) to head (a8c46f7).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...a/com/github/simy4/coregex/core/CoregexParser.java 28.57% 25 Missing ⚠️
...in/java/com/github/simy4/coregex/core/Coregex.java 75.28% 18 Missing and 4 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #175      +/-   ##
============================================
+ Coverage     65.45%   68.68%   +3.23%     
- Complexity      142      154      +12     
============================================
  Files            14       15       +1     
  Lines           851      958     +107     
  Branches        118      138      +20     
============================================
+ Hits            557      658     +101     
- Misses          250      252       +2     
- Partials         44       48       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SimY4 SimY4 added the enhancement New feature or request label Aug 27, 2025
@SimY4 SimY4 added this to the 1.4.0 milestone Aug 27, 2025
@SimY4 SimY4 self-assigned this Aug 27, 2025
@SimY4 SimY4 requested a review from Copilot August 27, 2025 21:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements support for positive and negative look-ahead and look-behind patterns in the regex engine, addressing issue #34. The implementation introduces a rewind mechanism to handle cases where lookaround patterns fail to match.

  • Adds lookaround pattern support with positive/negative look-ahead/look-behind functionality
  • Introduces a rewind mechanism using RewindException for pattern matching failures
  • Refactors the API to use string-based matching instead of character-based operations

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
CoregexInstances.scala Refactors shrink implementation using LazyList.unfold for better functional style
SetSuite.scala Updates tests to use new string-based matching API and adds Locale import
CoregexSuite.scala Adds new test cases for literal and group matching functionality
CoregexParserSuite.scala Updates test expectations from UnsupportedOperationException to IllegalStateException
CoregexArbitraries.scala Adds shrink instances for Coregex types and imports option converters
Set.java Removes IntPredicate interface and implements string-based matching
RewindException.java New exception class for handling pattern rewind scenarios
CoregexParser.java Implements parsing logic for lookaround patterns
Coregex.java Major refactoring to support lookaround patterns and string-based matching

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SimY4 SimY4 force-pushed the topic/look-around branch from 82c22a5 to 0918542 Compare August 29, 2025 02:20
@SimY4 SimY4 merged commit 932c3eb into main Sep 1, 2025
4 checks passed
@SimY4 SimY4 deleted the topic/look-around branch September 1, 2025 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for positive and negative look-ahead, look-behind predicates

2 participants

Comments