Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

fix: fix symbol checking and creation for subst with a regexp - #906

Merged
jaqx0r merged 1 commit into
google:mainfrom
terencehonles:fix-multiple-subst-regexp-calls
Aug 8, 2024
Merged

jaqx0r merged 1 commit into
google:mainfrom
terencehonles:fix-multiple-subst-regexp-calls

Conversation

@terencehonles

@terencehonles terencehonles commented Aug 5, 2024 •

Copy link
Copy Markdown
Contributor

This change updates the checkRegex helper to not track symbols for a regexp when it is used by the builtin subst. In this case the VM will not store these matches, and therefore these symbols will not be available to the program. The compiler will, however, compile these regexp and add them to the regexp table for use by the VM, and multiple calls to subst are already handled by the VM.

fixes: #693, fixes: #810

This change updates the ``checkRegex`` helper to not track symbols for a
regexp when it is used by the builtin ``subst``. In this case the VM
will not store these matches, and therefore these symbols will not be
available to the program. The compiler will, however, compile these
regexp and add them to the regexp table for use by the VM, and multiple
calls to ``subst`` are already handled by the VM.

fixes: google#693, google#810
@terencehonles
terencehonles force-pushed the fix-multiple-subst-regexp-calls branch from bae620f to c7ba9c4 Compare August 8, 2024 09:44
@terencehonles terencehonles changed the title fix: allow multiple calls to subst with a regexp fix: fix symbol checking and creation for subst with a regexp Aug 8, 2024
@jaqx0r
jaqx0r enabled auto-merge August 8, 2024 22:11
@jaqx0r
jaqx0r added this pull request to the merge queue Aug 8, 2024
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.57%. Comparing base (06d5ac8) to head (c7ba9c4).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #906      +/-   ##
==========================================
+ Coverage   57.52%   57.57%   +0.04%     
==========================================
  Files          68       68              
  Lines        6908     6915       +7     
==========================================
+ Hits         3974     3981       +7     
  Misses       2669     2669              
  Partials      265      265              

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

Merged via the queue into google:main with commit 246e5ca Aug 8, 2024
@terencehonles
terencehonles deleted the fix-multiple-subst-regexp-calls branch August 9, 2024 06:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 subst() calls within a single scope breaks compilation regex ..Redeclaration of capture group `0' previously declared

3 participants