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

Merged
merged 1 commit into from
Aug 29, 2024

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.

@lildude lildude added this pull request to the merge queue Aug 29, 2024
Merged via the queue into github-linguist:master with commit 0943766 Aug 29, 2024
5 checks passed
@DecimalTurn DecimalTurn deleted the rm-backreferences branch August 29, 2024 15:19
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Dec 20, 2024
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.

4 participants