diff options
author | Georg Brandl <georg@python.org> | 2017-01-22 18:39:29 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2017-01-22 18:39:29 +0000 |
commit | f43efe1289f48dfffaaf5cc7d28e6387871df20e (patch) | |
tree | a4a300a50b11a400f7e59d4f0887fd2291bcce4d /pygments/lexers/haskell.py | |
parent | bbb5f9f0c4b0262c97faa295990d64c97899945c (diff) | |
parent | 3e25956599a32484f656f9928b66f35917a8ac79 (diff) | |
download | pygments-f43efe1289f48dfffaaf5cc7d28e6387871df20e.tar.gz |
Merged in AndreBremer/pygments-main (pull request #597)
Image Formatter: Mac-specific lookup for fonts (fixes #868)
Diffstat (limited to 'pygments/lexers/haskell.py')
-rw-r--r-- | pygments/lexers/haskell.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pygments/lexers/haskell.py b/pygments/lexers/haskell.py index ffc3a3a2..9020ceb6 100644 --- a/pygments/lexers/haskell.py +++ b/pygments/lexers/haskell.py @@ -5,7 +5,7 @@ Lexers for Haskell and related languages. - :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -39,7 +39,7 @@ class HaskellLexer(RegexLexer): flags = re.MULTILINE | re.UNICODE reserved = ('case', 'class', 'data', 'default', 'deriving', 'do', 'else', - 'if', 'in', 'infix[lr]?', 'instance', + 'family', 'if', 'in', 'infix[lr]?', 'instance', 'let', 'newtype', 'of', 'then', 'type', 'where', '_') ascii = ('NUL', 'SOH', '[SE]TX', 'EOT', 'ENQ', 'ACK', 'BEL', 'BS', 'HT', 'LF', 'VT', 'FF', 'CR', 'S[OI]', 'DLE', @@ -63,6 +63,9 @@ class HaskellLexer(RegexLexer): (r'^[_' + uni.Ll + r'][\w\']*', Name.Function), (r"'?[_" + uni.Ll + r"][\w']*", Name), (r"('')?[" + uni.Lu + r"][\w\']*", Keyword.Type), + (r"(')[" + uni.Lu + r"][\w\']*", Keyword.Type), + (r"(')\[[^\]]*\]", Keyword.Type), # tuples and lists get special treatment in GHC + (r"(')\([^\)]*\)", Keyword.Type), # .. # Operators (r'\\(?![:!#$%&*+.\\/<=>?@^|~-]+)', Name.Function), # lambda operator (r'(<-|::|->|=>|=)(?![:!#$%&*+.\\/<=>?@^|~-]+)', Operator.Word), # specials |