Skip to content

Implement Thompson NFA-based Regular Expressions#1172

Open
JAi-SATHVIK wants to merge 108 commits intofortran-lang:masterfrom
JAi-SATHVIK:regex
Open

Implement Thompson NFA-based Regular Expressions#1172
JAi-SATHVIK wants to merge 108 commits intofortran-lang:masterfrom
JAi-SATHVIK:regex

Conversation

@JAi-SATHVIK
Copy link
Copy Markdown
Contributor

issue #1163

@JAi-SATHVIK JAi-SATHVIK marked this pull request as draft March 31, 2026 19:48
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 90.95355% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.28%. Comparing base (3b447b9) to head (7b00548).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/regex/stdlib_regex.f90 87.63% 35 Missing ⚠️
test/regex/test_regex.f90 98.41% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1172      +/-   ##
==========================================
+ Coverage   68.66%   69.28%   +0.62%     
==========================================
  Files         408      410       +2     
  Lines       13619    14028     +409     
  Branches     1537     1602      +65     
==========================================
+ Hits         9351     9719     +368     
- Misses       4268     4309      +41     

☔ 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.

@JAi-SATHVIK JAi-SATHVIK marked this pull request as ready for review April 3, 2026 21:24
@JAi-SATHVIK
Copy link
Copy Markdown
Contributor Author

Hi @jalvesz @jvdp1, The "cmake-3.14" job in CI is failing because pip install cmake==3.14.3 requested a version which is no longer available on the PyPI index. can we update the .github/workflows/CI.yml to use cmake==3.14.3.post1?

@JAi-SATHVIK
Copy link
Copy Markdown
Contributor Author

JAi-SATHVIK commented Apr 4, 2026

Update

I have finalized the core implementation of the pure Fortran regex engine. Here is a summary of what I've completed:

  • Correct Shunting-Yard Parsing: Fixed logic bugs in the parser to properly handle parentheses (( and )) and operator precedence during postfix conversion.
  • Lexer Anchor Handling: Updated the lexer to accurately handle start (^) and end ($) anchors with correct implicit concatenation logic.
  • Accurate Match Reporting: Fixed an off-by-one error in regmatch to ensure correct 1-based match_start indices.
  • Safety and Stability: Hardened the engine against out-of-bounds access and memory issues by refactoring eager logical evaluations and utilizing local state management for thread safety.
  • Unit Test Integration: Migrated the test suite to the repository's standard test-drive framework, with 10 comprehensive test cases covering literals, character classes, anchors, and alternation.

The engine is now stable, zero-dependency, and ready for your feedback! @arjenmarkus @jvdp1 @jalvesz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants