language-haskell
language-haskell copied to clipboard
Some character literals are not highlighted
Most character literals are highlighted properly, but some - like vowels with tildes - are not.
See the following example:
Using Horizon theme, but can reproduce with any theme.
Example characters are as follow (GitHub doesn't highlight characters):
x = ['a', '`', '~', '!', '@']
y = ['¹', 'á', '¶', '«', '»', '¿']
If you or anyone else wants to submit a PR for this go ahead. This should be a reasonably easy fix augmenting the character regex?
Any hints on where the regexes are defined? I've never worked on syntax highlighting.
You can try looking at the scopes it is being assigned to. Each rule assigns a, usually descriptively named, "scope" to the thing it matches. For instance a literal 1
will be constant.numeric.floating.decimal.haskell
or ->
is keyword.operator.arrow.haskell
. So if you search for character
or char
or constant
you should find the scope for character literals and it will have a rule attached that contains the regex used for matching. Be careful though, it may be that it is used in multiple places (probably not though).
Maybe one last hint, the tmLanguage
file is in the plist
format, which basically means its JSON, but in XML format and I'm sure you'll figure out how that works when you look at it :wink:
And if you need help with the regex syntax, this is where you can find information (also about how to specify character classes and such) https://macromates.com/manual/en/regular_expressions
Wanted to add that the characters §
and £
aren't highlighted as well