Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve regex analysers in XML #831

Merged
merged 1 commit into from Aug 23, 2023

Conversation

gandarez
Copy link
Contributor

@gandarez gandarez commented Aug 23, 2023

This PR improves the regexes analysers in XML by adding the single attribute and changing how regex nodes are implemented. Some analysers break in the first match where others sum all scores and return, the single attribute when true returns the score for the first match. The regex order matters.

<analyse single="true" >
      <regex pattern="(?m)^\s*#include &lt;" score="0.1" />
      <regex pattern="(?m)^\s*#ifn?def " score="0.1" />
</analyse>

Ref #828

@alecthomas
Copy link
Owner

Nice, thanks!

@alecthomas alecthomas merged commit 708662a into alecthomas:master Aug 23, 2023
2 checks passed
@gandarez
Copy link
Contributor Author

Thanks for merging it. Any plan to release it soon?

@gandarez gandarez deleted the feature/xml-analyser branch August 23, 2023 10:59
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.

None yet

2 participants