#210 Merged
Repository
raichoo raichoo
Branch
default
Repository
birkenfeld birkenfeld
Branch
default

Idris lexer: added lexer for Idris

Author
  1. raichoo avatarraichoo
Reviewers
Description

A lexer for the dependently typed programming language Idris (http://idris-lang.org)

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/find_error.py 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.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.