You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some code I am working in is using a function called module', but this severely messes up the syntax highlighting.
The reason is that all keywords in the grammar file is using \b to detect whole words. As I gather it, the \b will match any \w up until \W, where \w is a shorthand for [a-zA-Z0-9_] and \W is anything but \w. This is in conflict with Haskell's syntax, which actually allows any variable definition to end with '. I did a quick hack where I replaced the ending \b for the module-keyword with the following non-capturing group and it fixed the issue: (?:[^a-zA-Z0-9_'])
This problem is certainly affecting all keywords, and I was considering doing a pull request but my textmate grammar skills aren't that great so it is hard for me to know what the impact would be.
The text was updated successfully, but these errors were encountered:
The new version should fix it for all keywords such as instance, module, class, let, where etc.
If you notice one that is still not correct please tell me, perhaps I forgot one.
@JustusAdam Thank you! I did a search, but only among open issues. Sorry for the trouble. I will try the new version and comment in #31 if I find any errors. Great work on this extension!
I understand. You assumed that if it was a closed issue it would have been fixed in the extension as well. I was going to publish the change soon anyways. It just was an unfortunate timing.
Thanks. I think this must be the only really actively maintained Haskell highlighting grammar 😆 .
Some code I am working in is using a function called
module'
, but this severely messes up the syntax highlighting.The reason is that all keywords in the grammar file is using
\b
to detect whole words. As I gather it, the\b
will match any\w
up until\W
, where\w
is a shorthand for[a-zA-Z0-9_]
and\W
is anything but\w
. This is in conflict with Haskell's syntax, which actually allows any variable definition to end with'
. I did a quick hack where I replaced the ending\b
for themodule
-keyword with the following non-capturing group and it fixed the issue:(?:[^a-zA-Z0-9_'])
This problem is certainly affecting all keywords, and I was considering doing a pull request but my textmate grammar skills aren't that great so it is hard for me to know what the impact would be.
The text was updated successfully, but these errors were encountered: