Skip to content

Commit 0225194

Browse files
[aslspec] adding source locations
1 parent 4d1f058 commit 0225194

File tree

12 files changed

+872
-677
lines changed

12 files changed

+872
-677
lines changed

asllib/aslspec/AST.ml

Lines changed: 241 additions & 106 deletions
Large diffs are not rendered by default.

asllib/aslspec/ASTUtils.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and vars_of_opt_named_type_terms opt_named_terms =
3636

3737
let variant_to_label_opt { TypeVariant.term } =
3838
match term with
39-
| Label label -> Some label
39+
| Label { label } -> Some label
4040
| Tuple { label_opt } | Record { label_opt } -> label_opt
4141
| _ -> None
4242

asllib/aslspec/PP.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let type_operator_to_token =
5353
let rec pp_type_term fmt =
5454
let open Term in
5555
function
56-
| Label name -> pp_print_string fmt name
56+
| Label { label } -> pp_print_string fmt label
5757
| TypeOperator { op; term } ->
5858
fprintf fmt "%s(%a)"
5959
(type_operator_to_token op |> tok_str)
@@ -65,10 +65,10 @@ let rec pp_type_term fmt =
6565
| Record { label_opt; fields } ->
6666
let label = Option.value label_opt ~default:"" in
6767
fprintf fmt "%s[%a]" label pp_record_fields fields
68-
| ConstantsSet constants ->
68+
| ConstantsSet { labels } ->
6969
fprintf fmt "%s(%a)" (tok_str CONSTANTS_SET)
7070
(pp_sep_list ~sep:"," pp_print_string)
71-
constants
71+
labels
7272
| Function { from_type; to_type; total } ->
7373
let keyword = if total then tok_str FUN else tok_str PARTIAL in
7474
fprintf fmt "%s %a -> %a" keyword pp_opt_named_type_term from_type
@@ -108,7 +108,7 @@ let pp_output_opt fmt is_output = if is_output then fprintf fmt "--@," else ()
108108
let rec pp_expr fmt =
109109
let open Expr in
110110
function
111-
| Var name -> pp_print_string fmt name
111+
| Var { id } -> pp_print_string fmt id
112112
| UnresolvedApplication { lhs; args } ->
113113
fprintf fmt "%a(%a)" pp_expr lhs (pp_comma_list pp_expr) args
114114
| Tuple { label_opt; args } ->

asllib/aslspec/SpecParser.mly

Lines changed: 85 additions & 84 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)