catala/compiler
Louis Gesbert 2003566867 Force parens in compound logic formulas
Closes #373

This forbids expressions such as `a and b or c`, avoiding the need to set an
implicit priority between `and`, `or` and `xor`, which I find error-prone.

Instead, when that appears, a message asking for explicit parentheses will be
shown to the user.

Implementation note: since that would be extremely tedious to do in the parser
directly, the parser is set to allow right-associativity without discrimination
for the logical operators, and the check is done during desugaring. This
required to explicit parentheses in the surface AST to discriminate the case
where the priority was explicit.
2023-01-04 10:46:14 +01:00
..
catala_utils Add overloaded operators for the common operations 2022-12-13 11:55:24 +01:00
dcalc Small cleanup/fixes following PR review on Syntax Changes 2022-12-20 16:03:41 +01:00
desugared Force parens in compound logic formulas 2023-01-04 10:46:14 +01:00
lcalc Add overloaded operators for the common operations 2022-12-13 11:55:24 +01:00
literate Tweak error message location printing 2022-11-28 16:38:09 +01:00
plugins Define Catala_utils.String as an overlay to stdlib string 2022-11-28 16:38:09 +01:00
scalc Replace the type conversion and rounding operators with overloads 2022-12-13 15:32:49 +01:00
scopelang Add overloaded operators for the common operations 2022-12-13 11:55:24 +01:00
shared_ast Add a notice on overload rules 2022-12-19 13:03:16 +01:00
surface Force parens in compound logic formulas 2023-01-04 10:46:14 +01:00
verification Replace the type conversion and rounding operators with overloads 2022-12-13 15:32:49 +01:00
catala_web_interpreter.ml Tweak error message location printing 2022-11-28 16:38:09 +01:00
catala.ml Big reformatting 2022-03-08 15:03:14 +01:00
driver.ml Add typing-based disambiguation pass after desugaring 2022-11-28 16:38:09 +01:00
driver.mli Tweak error message location printing 2022-11-28 16:38:09 +01:00
dune Rename utils to catala_utils 2022-11-28 16:38:09 +01:00
index.mld Rename utils to catala_utils 2022-11-28 16:38:09 +01:00
plugin.ml Rename utils to catala_utils 2022-11-28 16:38:09 +01:00
plugin.mli Rename utils to catala_utils 2022-11-28 16:38:09 +01:00