From be79c58ac13042496ad50b167ab5217296e65150 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 1 Nov 2018 13:09:48 -0400 Subject: [PATCH] haskell: Properly highlight promoted data constructors 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. --- lib/rouge/lexers/haskell.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rouge/lexers/haskell.rb b/lib/rouge/lexers/haskell.rb index 72a858035b..e756836731 100644 --- a/lib/rouge/lexers/haskell.rb +++ b/lib/rouge/lexers/haskell.rb @@ -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