Reason: refmt breaks on local exceptions

Created on 28 Sep 2017  路  7Comments  路  Source: reasonml/reason

Using OCaml 4.04.2 and Reason 1.13.7 installed via opam:

$ echo 'let () = let exception E in raise E' | refmt --parse=ml --print=re
refmt: internal error, uncaught exception:
       Invalid_argument("No match for unparsing expression")

Most helpful comment

Thanks for reporting, it's one of those not yet implemented!
Will get to it this weekend.

All 7 comments

Thanks for reporting, it's one of those not yet implemented!
Will get to it this weekend.

Do you think this will land before the big syntax update?

I'll do my best. Looked at it two weekends & it was a lot less trivial than I thought... #parsingIsHardEvenWithMenhir

Thank you for taking a look!

Managed to parse & print:

let () = {
  exception E;
  raise(E)
};

What do you think of the Reason equivalent?
Would you expect let expression to work?

I'd prefer exception E; as you have it written, to mirror how local module definitions work. I'm ok with let exception E; not working as this wasn't previously supported in Reason so there's no old syntax (aside from OCaml) to be used to.

Done

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chenglou picture chenglou  路  3Comments

modlfo picture modlfo  路  4Comments

shaneosullivan picture shaneosullivan  路  3Comments

rickyvetter picture rickyvetter  路  3Comments

braibant picture braibant  路  4Comments