diff options
-rw-r--r-- | pygments/lexers/functional.py | 4 | ||||
-rw-r--r-- | tests/examplefiles/import.hs | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/pygments/lexers/functional.py b/pygments/lexers/functional.py index 5baa18e9..af9918a0 100644 --- a/pygments/lexers/functional.py +++ b/pygments/lexers/functional.py @@ -977,10 +977,10 @@ class HaskellLexer(RegexLexer): (r'\s+', Text), (r'[A-Z][a-zA-Z0-9_]*', Keyword.Type), (r'(_[\w\']+|[a-z][\w\']*)', Name.Function), + (r'--(?![!#$%&*+./<=>?@\^|_~:\\]).*?$', Comment.Single), + (r'{-', Comment.Multiline, 'comment'), (r',', Punctuation), (r'[:!#$%&*+.\\/<=>?@^|~-]+', Operator), - (r'--.*$', Comment.Single), - (r'{-', Comment.Multiline, 'comment'), # (HACK, but it makes sense to push two instances, believe me) (r'\(', Punctuation, ('funclist', 'funclist')), (r'\)', Punctuation, '#pop:2'), diff --git a/tests/examplefiles/import.hs b/tests/examplefiles/import.hs index 5ececfea..f266f62e 100644 --- a/tests/examplefiles/import.hs +++ b/tests/examplefiles/import.hs @@ -1,7 +1,15 @@ import "base" Data.Char +import "base" Data.Char (isControl, isSpace) +import "base" Data.Char (isControl, --isSpace) + isSpace) +import "base" Data.Char (isControl, -- isSpace) + isSpace) (-->) :: Num a => a -- signature -(-->) = 2 -- implementation +(-->) = 2 -- >implementation + +--test comment +-- test comment main :: IO () main = putStrLn "hello world" |