Skip to content
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

Menhir/ocamlyacc support #152

Open
kit-ty-kate opened this issue Oct 18, 2017 · 9 comments
Open

Menhir/ocamlyacc support #152

kit-ty-kate opened this issue Oct 18, 2017 · 9 comments
Assignees

Comments

@kit-ty-kate
Copy link
Member

Currently, tuareg doesn't support .mly files very well. The highlight works fine but the automatic indentation can be a bit wacky when it comes to rules. Is there a way to disable automatic indentation in .mly files or part of it (everything that is not in braces) ? I don't know how hard it would be to support it at least partly but maybe until ocp-indent comes-up with its own support (see
OCamlPro/ocp-indent#50), maybe it can be at least partially supported by tuareg if it's not too complicated.

@Chris00 Chris00 self-assigned this Oct 19, 2017
@Chris00
Copy link
Member

Chris00 commented Oct 19, 2017

The current (git) version of Tuareg is not activated for .mly files. I plan to have a special (dual) mode for such files but I've had not time to investigate how to do that properly.

@pmetzger
Copy link
Member

A special mode would be very appreciated. I don't know how to accomplish it, but it should probably switch between some mechanism to handle indentation of Menhir when outside of { } blocks, and the normal OCaml indentation when it is within them.

@monnier
Copy link
Contributor

monnier commented Oct 26, 2017

It should be reasonably easy to provide such a major mode as a "minor" tweak to Tuareg mode (i.e. reusing most of Tuareg's highlight and indentation rules, and adding some rules specific to .mly files). In sml-mode, I implemented such an sml-yacc-mode with about 3KB of code.

@monnier
Copy link
Contributor

monnier commented Nov 30, 2017

I've just pushed a primitive tuareg-menhir.el file to Tuareg's master branch. There's ample room for improvement, but at least now there's something on which to build.

@pmetzger
Copy link
Member

Woot!

@pmetzger
Copy link
Member

(So what's the easiest way to try this out?)

@Chris00
Copy link
Member

Chris00 commented Dec 14, 2017

Try melpa or install the Git version (opam pin...).

@pmetzger
Copy link
Member

pmetzger commented Jun 2, 2018

Would it be possible to do a new release with tuareg-menir.el in it?

@Chris00
Copy link
Member

Chris00 commented Sep 14, 2018

Release in progress: ocaml/opam-repository#12627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants