-
Notifications
You must be signed in to change notification settings - Fork 11
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
Invalid regexes as detected by GitHub's grammar compiler #99
Comments
Hi @lildude , if I understand correctly, since this highlighter was designed with Oniguruma in mind, this is not really an issue with the content per se. I'm fairly recent to take up on this topic so would you mind if I ask: how can one describe the same content with PCRE? If it's not possible, the change would have questionable value. |
https://www.regular-expressions.info/unicode.html#category is a great resource for this. |
A follow-up: Alpha = L(etter) or M(ark) Hopefully they would work with Oniguruma as well; honestly, I had to look up what a mark approximately is in the first place. 😅 |
NOT TESTED!!! Per Raku#99, Github's regex validator does not accept Oniguruma regexes. There's some escaping/filtering going on that makes the report hard to interpret but I'm pretty sure I figured it out. (I think it's just some `\\p{Alpha}`s that needed translating to `\\pL\\pM`, and a `"("` and `")"` pair of strings that needed escaping of the parens).
Anyone reading this, ignore the specifics listed in the opening comment. Instead, click Outstanding Grammar Issues to view the latest Raku errors, if any. At the time of writing this comment the file with errors in it has changed its name to
I've PR'd an edit of the file that I think (not tested!) does the minimal change of the things Github is saying are invalid. I'm actually suspicious the |
#103 is out now; hopefully we get to see the result of it soon. |
github-linguist/linguist#3924 (comment) seems like we are good now, as far as the syntax goes. Closing this issue. |
Ugh. It looks like I misinterpreted the column count of some of the error messages (the column count was ambiguously pointed at the Anyway, thanks for fixing that and shepherding this to a successful conclusion. |
👋 I'm the lead maintainer of the https://github.com/github/linguist library which is used for language detection and providing the syntax highlighting for languages on GitHub.com, and we use this grammar.
Our grammar compiler has found a problem with your grammar which I thought I'd let you know about.
GitHub uses PCRE instead of Ruby's Oniguruma regex engine for performance reasons which means some of your regexes aren't interpretted, in this case the
\p
character classes.Example Code
N/A
Picture [optional]
Leave this in. For internal use.
The text was updated successfully, but these errors were encountered: