Closed denismerigoux closed 3 weeks ago
I think it would be quite useful to me as well to have an Error
case in the AST, because it would allow me to continue other branches of evaluation after an error is found.
I have been considering using OCaml's Result
module to make the concolic evaluator return a ((dcalc,'m) gexpr, type_for_errors) result
, but an AST case would probably be better. How much effort do you think it would need to at least add the Error
AST case (even if it's underused at first)?
I guess one solid (if not two) days of refactoring following the OCaml compiler errors...
Vincent has implemented this for parsing and typechecking errors only. This issue is closed in favor of a new one that should generalize this mechanism.
Currently, the Catala compiler exits at the first error it encounters. It would be nice to only exit when the errors it has found forbid it to continue processing, so that it displays multiple related error messages in the same run.
For that, every AST should be augmented with an
Error
case produced when an error message is raised. The compiler could then continue its operations until it actually needs to do something with the location of the AST whereError
is, in which case it would exit.