Remove some lookaheads#7242
Conversation
|
@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. 🤷♂️ |

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.