-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Remove some lookaheads #7242
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 some lookaheads #7242
Conversation
Brief explanation of the logic behind the changes: ActionScript: BrighterScript: FreeMarker: RUNOFF: Solidity: Hosts File: |
@Alhadis, I think I'll let you handle the |
@DecimalTurn The heuristic used by linguist/lib/linguist/strategy/modeline.rb Lines 52 to 126 in c959cb5
Any changes to Linguist::Strategy::Modeline::VIM_MODELINE will logically need to be reflected in the heuristic, and I strongly advise against making the regex even less readable by replacing nested lookaheads with… whatever works with In other words, you'll probably have to make an exception upstream for this particular heuristic. 🤷♂️ |
Ok, I'm going to take your advice on this one and leave it be for now. |
Description
Removing lookaheads in those regexes will help with portability across librairies using Re2-style regexes and should help ensure that our regexes run linearly.
Note that to demonstrate that this PR doesn't break ActionScript's heuristics, #7241
should be merged before changing this PR from a draft to a real PR.