reasonml / reason

Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems
http://reasonml.github.io
MIT License
10.08k stars 425 forks source link

Error recovery for letops #2668

Open anmonteiro opened 2 years ago

anmonteiro commented 2 years ago

Parser can't do automatic semicolon insertion (error recovery). Example:

Works:

let x = { 3; } // no semicolon, `refmt` can parse and insert it
let x = { 3; };

Doesn't work:

let+someOp x = { 3; } // no semicolon, `refmt` chokes
let x = { 3; };
SanderSpies commented 1 year ago

The following does parse:

let x = {
  let+foo xx = { x }
  xx
};

while

  let+foo xx = { x };

does not (note the semicolon).

SanderSpies commented 1 year ago

@anmonteiro I'm trying to reproduce this case - but failing to do so.

anmonteiro commented 1 year ago

It might be outdated, but note that letops are expressions, not structure items