HS-Flensburg-PLTP / language-ocaml-bnfc

MIT License
0 stars 0 forks source link

Fix precedence of semicolon #10

Open jan-christiansen opened 1 week ago

jan-christiansen commented 1 week ago

The precedence of semicolon in combination with let expressions is not correct. The following expression is not parsed correctly.

let test =
  let x = 3 in
  x;
  |> ignore
jan-christiansen commented 1 week ago

In the expression let x = 1 in x ; 2 the precedence of ; is actually higher then that of let, that is, we get let x = 1 in (x ; 2) as result. However, if the tokens succeeding ; is not a complete expression, as in the example above, the ; is associated to the let expression.