-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
haskell: Properly highlight promoted data constructors #1027
Conversation
Unfortunately there is a bit of ambiguity with char literals. For instance, the data constructor `A'` would be `'A'` in promoted form. This will still be highlighted as as char literal but this is the best we can do without more context.
Ping. |
@bgamari Sorry it's taken so long for a response. Could you add an example of this promotion to the visual sample? |
@goolord Are you able to provide a code sample (just as a comment here is fine)? I'm not familiar enough with Haskell to try to write one on my own. I'm also not sure if the regex is correct. The regex as written requires a constructor to be at least two alphanumeric characters. Shouldn't it be fine just to have one? |
@goolord Thanks for the quick reply :) Makes sense. My only comment would be that I think the regex should be the following: rule /'[A-Z]\w+'?/, Keyword::Type # promoted data constructor |
Unfortunately there is a bit of ambiguity with char literals.
For instance, the data constructor
A'
would be'A'
in promoted form.This will still be highlighted as as char literal but this is the best
we can do without more context.