csharp-tmLanguage
csharp-tmLanguage copied to clipboard
csharp.tmLanguage: invalid pattern in look-behind
Details
What editor are you seeing the problem in? (e.g. Atom, Visual Studio Code, etc.) Ruby, Eclipse TM4E
What version of the editor are you using? 0.9
What color theme are you using? Solarized
Repro
TextMate uses the oniguruma syntax for regular expressions.
The await-statement
pattern at
https://github.com/dotnet/csharp-tmLanguage/blob/7a7482ffc72a6677a87eb1ed76005593a4f7f131/grammars/csharp.tmLanguage#L2939-L2942
however is not parsable using the oniguruma regex library and results in invalid pattern in look-behind
.
you can try it here https://onecompiler.com/ruby/422uzf35h Ruby uses the oniguruma library for regex parsing.
I think the issue is the usage of variable-length negative look-behind.
It might be easily solvable by changing:
from: /(?<!\.\s*)\b(await)\b/
to: /(?<!\.)\s*\b(await)\b/
i.e.
from: <string>(?<!\.\s*)\b(await)\b</string>
to: <string>(?<!\.)\s*\b(await)\b</string>
Ruby, Eclipse TM4E must be using an outdated version of oniguruma as the current version of oniguruma does support variable length lookbehinds
Yeah we are using the implementation from JRuby which apparently lags behind. Thanks for your pointer.