Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Update keyword.operator.comparison.go regex #145
Description of the Change
The regex to match
If the negative lookahead is considered to be too greedy, the regex catching the bitwise operators could be placed before this regex and thus allowing to remove
Resolving several minor erroneous syntax highlights involving the less than/greater than operators.
No drawbacks identified so far.
Syntax highlights of anything in the regex format of:
Excellent catch @TheHominid.
I think I'd prefer this solution. Could you also add some new specs to ensure that this behavior doesn't regress in the future?
And indeed the only way to bot break everything is to split some of these regex to then create the proper order of execution. Now, this completely defeats the purpose of avoiding negative lookaheads for potential performance issues.
So I've spent some additional time investigating whether the negative lookahead is indeed resource hungry and it doesn't seem so, also because it is combined with a fixed character that is checked before and thus the overall complexity is significantly reduced. (Sources:
As solution I just left unchanged my previous fix and I've added in the specs in