Add support for LaTeX \verb|...| command in pattern matching #86
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 pull request introduces changes to support verbatim patterns in LaTeX files. The most important changes include adding the
VERB
constant to the regexes, updating thePattern
struct to track verbatim patterns, and modifying the logic to handle verbatim patterns in theget_verbatim_diff
function.Changes to support verbatim patterns:
src/regexes.rs
: Added theVERB
constant to match LaTeX\verb|...|
patterns and updated theSPLITTING
array to include the verbatim pattern. Also added a new regexRE_VERB
to capture content inside\verb|...|
. [1] [2]src/format.rs
: Updated thePattern
struct to include acontains_verbatim
field and modified theimpl Pattern
block to set this field based on the presence of verbatim patterns. [1] [2] [3]src/verbatim.rs
: Modified theget_verbatim_diff
function to return1
if the pattern contains verbatim patterns.Test updates:
tests/verbatim/source/verbatim.tex
andtests/verbatim/target/verbatim.tex
: Added test cases for verbatim patterns to ensure the changes work as expected.Result:
Should close issue #83