Reason: [Syntax] Semicolon rules confusing

Created on 20 Mar 2016  路  1Comment  路  Source: reasonml/reason

This could go on and on so I'll only file one issue for it. I'll collect all the confusing parts of semicolon here.

  • In a switch/catch block there shouldn't be a semicolon like this:
switch x {
| a => 5;
}
  • In a local open, there shouldn't be one:
MyModule.(bla;)
  • Braces not followed by semi:
let f => blablabla
let a = 5;
if (true) {
  ...
}
let a = 5;

And this is a bit nuanced, formatting this will succeed by with the wrong result (f slurped inside else block):

if (true) {a} else {b}
f ();
Error messages Syntax

>All comments

It will be good to have ASI or remove the semicolons from the language and have the return keyword may be

Was this page helpful?
0 / 5 - 0 ratings

Related issues

modlfo picture modlfo  路  4Comments

ostera picture ostera  路  3Comments

ondrejsevcik picture ondrejsevcik  路  3Comments

rickyvetter picture rickyvetter  路  4Comments

kyldvs picture kyldvs  路  3Comments