Idris lexer: added lexer for Idris

#210 Merged at 940b9ec
  1. raichoo

A lexer for the dependently typed programming language Idris (

Comments (19)

  1. Tim Baumann

    Cool! With a few more lines of code, you can now define a lexer for literate Idris files (*.lidr) as well! (And thereby justify the abstraction I introduced with the class LiterateLexer :-) )

  2. raichoo author

    Looks like github already knows Idris but since this is not in the main branch they cannot benefit from syntax highlighting. I'm honestly a bit frustrated with the non-responsiveness of the pygments developers.

  3. raichoo author

    Thanks a lot for merging :D I'd be fine with that 'raichoo' will do. Most people just know me by that name :) If that's not ok you can just leave me out. I'm happy enough I could get that code into pygments :)

  4. Georg Brandl repo owner

    Unfortunately it seems that the example file cannot be processed by the lexer. This line isn't lexed:

    interpTy (TyFun s t) = interpTy s -> interpTy t

    (at the (TyFun)

    Can you have a look?

  5. raichoo author

    Of course. I can check later tonight. I'm currently at work. I will send a pull request after I've figured out what's going wrong. How do you check highlighting. It seems to work just fine over here. Maybe I'm just not seeing what's going wrong.

  6. Georg Brandl repo owner

    The problem is that an Error token is generated. This will not lead to an error on highlighting, but usually a styling like "red background". Since error tokens shouldn't be generated for valid files, Pygments' test suite ensures that no such token is generated when processing the example files.

    You can use scripts/ in the source to display the generated tokens and the state stack before the Error token is generated.

  7. raichoo author

    Ok that says a lot. I see a lot of red here. Kind of embarrassing I thought that was highlighting for parens :/. Fixing that will be the first thing I'll do once I got home.