Surface.AstSourceAbstract syntax tree built by the Catala parser
Constructors are CamlCase
Idents are snake_case
type primitive_typ = | Integer| Decimal| Boolean| Money| Duration| Text| Date| Named of constructortype base_typ_data = | Primitive of primitive_typ| Collection of base_typ_data Pos.marked| Optional of base_typ_data Pos.markedtype struct_decl_field = {struct_decl_field_name : ident Pos.marked;struct_decl_field_typ : typ Pos.marked;}type struct_decl = {struct_decl_name : constructor Pos.marked;struct_decl_fields : struct_decl_field Pos.marked list;}type enum_decl_case = {enum_decl_case_name : constructor Pos.marked;enum_decl_case_typ : typ Pos.marked option;}type enum_decl = {enum_decl_name : constructor Pos.marked;enum_decl_cases : enum_decl_case Pos.marked list;}type literal_date = {literal_date_day : int Pos.marked;literal_date_month : int Pos.marked;literal_date_year : int Pos.marked;}type literal = | Number of literal_number Pos.marked * literal_unit Pos.marked option| Bool of bool| MoneyAmount of money_amount| Date of literal_datetype match_case = {match_case_pattern : match_case_pattern Pos.marked;match_case_expr : expression Pos.marked;}and expression = | MatchWith of expression Pos.marked * match_cases Pos.marked| IfThenElse of expression Pos.marked
* expression Pos.marked
* expression Pos.marked| Binop of binop Pos.marked * expression Pos.marked * expression Pos.marked| Unop of unop Pos.marked * expression Pos.marked| CollectionOp of collection_op Pos.marked
* ident Pos.marked
* expression Pos.marked
* expression Pos.marked| MemCollection of expression Pos.marked * expression Pos.marked| TestMatchCase of expression Pos.marked * constructor Pos.marked| FunCall of expression Pos.marked * expression Pos.marked| Builtin of builtin_expression| Literal of literal| EnumInject of constructor Pos.marked * expression Pos.marked option| EnumProject of expression Pos.marked * constructor Pos.marked| StructLit of constructor Pos.marked
* (ident Pos.marked * expression Pos.marked) list| Ident of ident| Dotted of expression Pos.marked * ident Pos.markedDotted is for both struct field projection and sub-scope variables
*)type rule = {rule_label : ident Pos.marked option;rule_exception_to : ident Pos.marked option;rule_parameter : ident Pos.marked option;rule_condition : expression Pos.marked option;rule_name : qident Pos.marked;rule_consequence : bool Pos.marked;}type definition = {definition_label : ident Pos.marked option;definition_exception_to : ident Pos.marked option;definition_name : qident Pos.marked;definition_parameter : ident Pos.marked option;definition_condition : expression Pos.marked option;definition_expr : expression Pos.marked;}type meta_assertion = | FixedBy of qident Pos.marked * ident Pos.marked| VariesWith of qident Pos.marked
* expression Pos.marked
* variation_typ Pos.marked optiontype assertion = {assertion_condition : expression Pos.marked option;assertion_content : expression Pos.marked;}type scope_use_item = | Rule of rule| Definition of definition| Assertion of assertion| MetaAssertion of meta_assertiontype scope_use = {scope_use_condition : expression Pos.marked option;scope_use_name : constructor Pos.marked;scope_use_items : scope_use_item Pos.marked list;}type scope_decl_context_scope = {scope_decl_context_scope_name : ident Pos.marked;scope_decl_context_scope_sub_scope : constructor Pos.marked;}type scope_decl_context_data = {scope_decl_context_item_name : ident Pos.marked;scope_decl_context_item_typ : typ Pos.marked;}type scope_decl_context_item = | ContextData of scope_decl_context_data| ContextScope of scope_decl_context_scopetype scope_decl = {scope_decl_name : constructor Pos.marked;scope_decl_context : scope_decl_context_item Pos.marked list;}type code_item = | ScopeUse of scope_use| ScopeDecl of scope_decl| StructDecl of struct_decl| EnumDecl of enum_decltype law_article = {law_article_name : string Pos.marked;law_article_id : string option;law_article_expiration_date : string option;}type law_include = | PdfFile of string Pos.marked * int option| CatalaFile of string Pos.marked| LegislativeText of string Pos.markedtype law_structure = | LawInclude of law_include| LawHeading of law_heading * law_structure list| LawArticle of law_article * law_article_item list| MetadataBlock of code_block * source_repr| IntermediateText of stringtype source_file_or_master = | SourceFile of program_item list| MasterFile of string Pos.marked list