-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functional Languages: ML/OCaml/Haskell #619
Comments
Incidentally, the apostrophe thing was fixed recently along with other things in #608. Here's how that snippet is rendered with the current master code: This is going to be in the next release. As for SML, if it's that simple could you take on doing this? We have developer docs over at http://highlightjs.readthedocs.org/. |
Awesome, thanks @isagalaev Yeah, I think I can fix the SML thing, I will simply change the OCaml definition to use the right SML keywords. I will see about making a merge request in the coming hours. |
I could confirm that your case case works, but this one doesn't fun append_my_list(xs, ys) =
case xs of
Empty => ys
| Cons(x, xs') => Cons(x, append_my_list(xs',ys)) It again misinterprets the apostrophe here. Changing the relevance in (ocaml lang) to
It solved the problem for me. No sure yet how relevance affects parsing, though. |
If you fixed it by changing the relevance then the problem was that it was highlighted as a different language. I'll look into it and see if I can find a more robust solution. Thanks for the test case! |
I fixed language detection so this Ocaml snippet is now recognized and highlighted correctly. If you find any other problem, please feel free to open a new issue. It's great to get feedback based on real-world testing :-). |
I have identified a few interesting problems while working with the syntax highlight of SML.
First, there is no support for SML itself. It defaults to OCaml but the keywords are not exactly the same although the syntax is. I guess, it is just a matter of taking the OCaml definition and use it for SML just with a different set of keywords.
That being said, the parser misinterprets the use of
'
(prime) in variables.In this case the parser interprets everything from the first
'
to the second one as a string. This happens in both Ocaml and Haskell.I tried to fix it myself, but my understanding of how languages are defined is limited and even after reading the documentation and comparing with other language definitions I did not manage to make it work for me, so I decided to report the issue and with luck you guys may fix it in the future.
The text was updated successfully, but these errors were encountered: