Acutis_internals.Ast
Define the untyped abstract syntax tree to be generated by the Parser
.
This type is equivalent to Menhir's $loc
keyword.
val loc_dummy : loc
type 'a assoc = (loc * string * 'a) list
type 'a assoc_nonempty = (loc * string * 'a) Nonempty.t
type 'a record = 'a value assoc_nonempty
type row = loc * [ `Closed | `Open ]
type ty =
| Ty_named of loc * string
| Ty_nullable of ty
| Ty_list of ty
| Ty_dict of ty
| Ty_enum_int of (loc * int) Nonempty.t * row
| Ty_enum_bool of (loc * int) Nonempty.t
| Ty_enum_string of (loc * string) Nonempty.t * row
| Ty_record of (loc * ty record) Nonempty.t * row
| Ty_tuple of ty list
type interface = prop list
The echo syntax is essentially a subset of the pattern syntax, one which only allows strings, variables, and record field access.
type pat =
| Var of loc * string
| Bool of loc * int
| Int of loc * int
| Float of loc * float
| String of loc * string
| Nullable of loc * pat option
| Enum_string of loc * string
| Enum_int of loc * int
| List of loc * pat list * pat option
| Tuple of loc * pat list
| Record of loc * pat record
| Dict of loc * pat assoc
| Block of loc * t
| Field of loc * pat * string
and node =
| Text of string * trim * trim
| Echo of (echo_format * echo) list * echo_format * echo * escape
| Match of loc * pat Nonempty.t * case Nonempty.t
| Map_list of loc * pat * case Nonempty.t
| Map_dict of loc * pat * case Nonempty.t
| Component of loc * string * string * pat assoc
| Interface of loc * interface
| Comment of string
and t = node list
val dummy_var : pat
A variable that is always ignored.
module Ty_repr : sig ... end
val pp_tag : Stdlib.Format.formatter -> tag -> unit
val pp_pat : Stdlib.Format.formatter -> pat -> unit