-
Notifications
You must be signed in to change notification settings - Fork 750
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
Add lexer for ReasonML #1248
Add lexer for ReasonML #1248
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! A ReasonML lexer! Had a couple of questions :)
@jneen Do you have an opinion on the way this has been structured? Rather than using the OCaml lexer as the superclass and simply overriding the bits that don't make sense, @sazarkin has separated the shared elements into a common class that both lexers inherit from (similar to how |
seems ok to me |
Thanks for a great feedback, I'll try to improve this PR |
@sazarkin IMO, the entire rule %r(/\*.*?\*/)m, Comment |
@ashmaroli we actually encourage breaking lexers down into further states, as it makes it possible to embed or escape within those states. (edit): also... it can't. These comments are nestable (see the invocation of |
It could stand to be written a little more neatly though, with less backslashes: rule %r|[^/*)]+|, Comment
rule %r|[/][*]|, Comment, :push
rule %r|[*][/]|, Comment, :pop!
rule %r|[*/]|, Comment |
Updated the comment part |
@sazarkin Thanks! Great to have a lexer for ReasonML as part of Rouge 🎉 |
Hi, I've added support for ReasonML https://reasonml.github.io/