Skip to content

Commit

Permalink
haskell: Properly highlight promoted data constructors (#21)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pyrmont authored May 11, 2019
1 parent ef830b1 commit c43527a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/rouge/lexers/haskell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def self.detect?(text)
# rule /^[_a-z][\w']*/, Name::Function
rule /[_a-z][\w']*/, Name
rule /[A-Z][\w']*/, Keyword::Type
rule /'[A-Z]\w[\w']*/, Keyword::Type # promoted data constructor

# lambda operator
rule %r(\\(?![:!#\$\%&*+.\\/<=>?@^\|~-]+)), Name::Function
Expand Down

0 comments on commit c43527a

Please sign in to comment.