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

Remove backreferences in regex patterns for XML Property List and JavaScript #6897

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DecimalTurn
Copy link
Contributor

@DecimalTurn DecimalTurn commented Jun 21, 2024

There is currently 2 discrepencies between Linguist and Enry that can be explained by the fact that RE2 doesn't support backreference:

From: https://github.com/go-enry/go-enry#divergences-from-linguist

In both cases, this is because the regex pattern is trying to make sure that the quotation mark used is the same to start and end the string. That's something important when performing syntax highlighting, but that doesn't provide much value in terms of distinguishing one language from another.

For that reason, the proposed changes won't make a noticable difference from Linguist's side, but it will remove the presence of backreferences for Enry.

@DecimalTurn DecimalTurn requested a review from a team as a code owner June 21, 2024 20:14
Copy link
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

Makes sense to me. Thanks.

Note: this PR will not be merged until close to when the next release is made. See here for more details.

@Alhadis Alhadis changed the title Remove backreferences in regex patterns for XML Property List and Javascript Remove backreferences in regex patterns for XML Property List and JavaScript Jun 24, 2024
Copy link
Collaborator

@Alhadis Alhadis left a comment

Choose a reason for hiding this comment

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

Good catch.

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

3 participants