Operator highlight extended and improved #50
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this PR some operators weren't correctly highlighted. One example is the tuple construction "1 /\ 2", it has weird "half-highlight", because it's not covered by operators and then gets caught by some other rule.
With this PR such highlight is hopefully fixed. For inspiration, I looked at the regexp from the official Atom purescript highlight. It works a bit differently: it excludes chars from class. AFAIK Emacs regexps can't do that, so instead I just enlisted the symbols. One thing I did differently though is including colon, because it is a valid operator in PureScript (for List), I think Atom has a bug in their regexp.
Another change being done is I replaced the underlying face from
variable-name-face
tobuiltin-face
. It is open for debate which face is the best, butvariable-name
is just wrong because it's far from what's actually being highlighted; and the face is used e.g. by color-identifiers-mode to find identifiers (variables or constants), which operators are not.