dad9b0f816
Some weeks ago, anonymous functions as expressions were added to PascaLIGO, unfortunately in a manner that allowed in theory for contexts in which a named function was found when an anonymous was expected, and vice-versa. That explains that the simplifier had two new possible errors: * unexpected_anonymous_function ("you provided a function declaration without name") * unexpected_named_function I changed the AST and the parser so that function expressions correspond to anonymous functions (without block) and function declarations correspond to named functions. I also removed a error in the simplifier, which was unused: * bad_bytes ("you provided a function expression with a name (remove it)")
16 lines
476 B
OCaml
16 lines
476 B
OCaml
(** Converts PascaLIGO programs to the Simplified Abstract Syntax Tree. *)
|
|
|
|
open Trace
|
|
open Ast_simplified
|
|
|
|
module Raw = Parser.Pascaligo.AST
|
|
module SMap = Map.String
|
|
|
|
(** Convert a concrete PascaLIGO expression AST to the simplified
|
|
expression AST used by the compiler. *)
|
|
val simpl_expression : Raw.expr -> expr result
|
|
|
|
(** Convert a concrete PascaLIGO program AST to the simplified program
|
|
AST used by the compiler. *)
|
|
val simpl_program : Raw.ast -> program result
|