Closed stevejb71 closed 2 years ago
/cc @kytrinyx. GitHub has Idris highlighting support or worst case, Haskell highlighting would probably be better than nothing.
Does http://github.com/jneen/rouge have idris support under a different name? If so we can map it to what we have in https://github.com/exercism/exercism.io/blob/master/lib/exercism/syntax_highlighter.rb#L6-L15
Looks like it doesn't. Purportedly Pygments style sheets are compatible and iirc Pygments supports Idris. Could we adapt it for Exercism?
If pygments supports it, how hard would it be to add it to rouge?
I just looked into the pygmens repo, I wasn't able to find a lexer for idris, also it is NOT listed on the page of supported languages.
So there is no pygments support we could port.
So I forked rogue yesterday and played around a bit, it seems to be not that hard to implement new lexers. The DSL is pretty simple. A problem is though, that there is no formal description of Idris' syntax and the parser code of the compiler itself... Well it needs to get cleaned up a bit ;) So I can't extract the necessary information from there.
I'm slowly starting to adapt some snippets from the Haskell Lexer though. But since I do currently have only a very limited amount of spare time, it might take a while until I have something I could PR to rogue.
Not sure if this would be of any use: https://github.com/david-christiansen/idris-code-highlighter
If nothing else, you might be able to reverse engineer the output of idris --highlight
(which doesn't need that repo).
Davids Highlighter transforms the output of idris --highlight
into HTML or LaTeX, so it relies on Idris beeing installed, and does not actually parse/scan idris sources, but a preformatted output. that is meant to be read by machines.
Also reverse engineering idris --highlight
will be near to impossible because of semantic highlighting. Also it works on the AST which was generated by the parser, which is a little bit messy and not really straightforward.
Quite right. There ought to be formal description somewhere..
There's something on readthedocs which is a mixture of semi formal description and examples...
Some parts are defined by some bnf style text, while others are only by example. Eg pragmas are bnf style, operators only by example and only a very small subset, arithmetic and compare...
Since it is 1.0 now perhaps we will have luck asking on the issue tracker or mailing list.
Eric Bailey notifications@github.com schrieb am Sa., 10. Juni 2017, 10:19:
Quite right. There ought to be formal description somewhere..
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/exercism/xidris/issues/15#issuecomment-307550925, or mute the thread https://github.com/notifications/unsubscribe-auth/AADmR7SRVbxVgpmhJP75dLowD4LehBYjks5sClGegaJpZM4MGFUu .
I'd recommend IRC too.
Thanks. I can't read text mate, but at least I should be able to use it as a base...
Eric Bailey notifications@github.com schrieb am Sa., 10. Juni 2017, 10:30:
It looks like maybe GitHub uses this https://github.com/idris-hackers/idris-sublime for GFM.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/exercism/xidris/issues/15#issuecomment-307551380, or mute the thread https://github.com/notifications/unsubscribe-auth/AADmR1mFdQJu4jiM33aZGzR7FFlf4sYzks5sClQmgaJpZM4MGFUu .
I submitted a solution for hello-world, got no syntax highlighting on the code.