-
Notifications
You must be signed in to change notification settings - Fork 79
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
Support exception branches in match #42
Comments
Placing braces around exception specification alleviates the problem somewhat, still a proper solution would be nice. |
The patch below should add support for that new syntax.
|
monnier
added a commit
that referenced
this issue
Oct 1, 2015
(tuareg-smie-grammar): Add OCaml-4.02's new "exception pattern". (tuareg-smie-forward-token, tuareg-smie-backward-token): Tweak the lexer for the new "exception" case. (tuareg--beginning-of-phrase): Don't jump over a let-d if we happen to find one before smie-backward-sexp bumps into it. (tuareg-reset-and-kwop): Move from tuareg_indent.el. (tuareg-imenu-create-index): Demote the scan error to a warning. * .gitignore: Add ELPA-generated files. * sample.ml (count_append): Add "exception case" test.
@roysc The Tuareg version at the time of this comment indents your code as let f =
let n =
match List.find ((=) 3) [1;2] with
| x -> x
| exception Not_found -> 0
in n so I think we can consider this fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In OCaml 4.02,
match
expressions have been extended to allowexception
branches. This isn't recognized yet, and using the syntax throws off font-lock and indentation.The text was updated successfully, but these errors were encountered: