Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
347 changes: 241 additions & 106 deletions asllib/aslspec/AST.ml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion asllib/aslspec/ASTUtils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ and vars_of_opt_named_type_terms opt_named_terms =

let variant_to_label_opt { TypeVariant.term } =
match term with
| Label label -> Some label
| Label { label } -> Some label
| Tuple { label_opt } | Record { label_opt } -> label_opt
| _ -> None

Expand Down
8 changes: 4 additions & 4 deletions asllib/aslspec/PP.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let type_operator_to_token =
let rec pp_type_term fmt =
let open Term in
function
| Label name -> pp_print_string fmt name
| Label { label } -> pp_print_string fmt label
| TypeOperator { op; term } ->
fprintf fmt "%s(%a)"
(type_operator_to_token op |> tok_str)
Expand All @@ -65,10 +65,10 @@ let rec pp_type_term fmt =
| Record { label_opt; fields } ->
let label = Option.value label_opt ~default:"" in
fprintf fmt "%s[%a]" label pp_record_fields fields
| ConstantsSet constants ->
| ConstantsSet { labels } ->
fprintf fmt "%s(%a)" (tok_str CONSTANTS_SET)
(pp_sep_list ~sep:"," pp_print_string)
constants
labels
| Function { from_type; to_type; total } ->
let keyword = if total then tok_str FUN else tok_str PARTIAL in
fprintf fmt "%s %a -> %a" keyword pp_opt_named_type_term from_type
Expand Down Expand Up @@ -108,7 +108,7 @@ let pp_output_opt fmt is_output = if is_output then fprintf fmt "--@," else ()
let rec pp_expr fmt =
let open Expr in
function
| Var name -> pp_print_string fmt name
| Var { id } -> pp_print_string fmt id
| UnresolvedApplication { lhs; args } ->
fprintf fmt "%a(%a)" pp_expr lhs (pp_comma_list pp_expr) args
| Tuple { label_opt; args } ->
Expand Down
169 changes: 85 additions & 84 deletions asllib/aslspec/SpecParser.mly

Large diffs are not rendered by default.

Loading
Loading