Haskell Lexer

Create issue
Issue #223 resolved
Former user created an issue

Attached is a Haskell lexer based on [http://haskell.org/onlinereport/lexemes.html the lexemes in the Haskell 98 Report]. It has been tested locally.

Reported by guest

Comments (9)

  1. Former user Account Deleted

    Also (unrelated, but important), I had an error earlier on where the stack trace went like this:

    ...
      File "/usr/local/lib/python2.5/site-packages/Pygments-0.7.1-py2.5.egg/pygments/lexer.py", line 367, in _process_state
        rex = re.compile(tdef[0], rflags)
      File "/usr/local/lib/python2.5/re.py", line 180, in compile
        return _compile(pattern, flags)
      File "/usr/local/lib/python2.5/re.py", line 233, in _compile
        raise error, v # invalid expression
    sre_constants.error: bogus escape (end of line)
    

    My problem was a malformed regular expression, but ''I couldn't tell from the trace what it was''. I ended up pre-compiling all my regexes to find it. You might want to think about catching errors during a compilation and logging what regular expression they were attached to.

  2. gbrandl

    Thanks, committed the new lexer in r3151. I also fixed the "compiling regex error" problem earlier.

  3. Former user Account Deleted

    The attached file escapes a backslash in one of the raw strings (wasn't recognizing the backslash as an operator).

  4. Log in to comment