@@ -25,9 +25,9 @@ open Parser;;
25
25
*
26
26
*)
27
27
28
- type meta = (Ast .ident * Pexp .pexp ) array ;;
28
+ type meta = (Ast .ident * Ast .pexp ) array ;;
29
29
30
- type meta_pat = (Ast .ident * (Pexp .pexp option )) array ;;
30
+ type meta_pat = (Ast .ident * (Ast .pexp option )) array ;;
31
31
32
32
type auth = (Ast .name * Ast .effect );;
33
33
@@ -42,22 +42,22 @@ type cexp =
42
42
| CEXP_auth of auth identified
43
43
44
44
and cexp_alt =
45
- { alt_val : Pexp .pexp ;
46
- alt_arms : (Pexp .pexp * cexp array ) array ;
45
+ { alt_val : Ast .pexp ;
46
+ alt_arms : (Ast .pexp * cexp array ) array ;
47
47
alt_else : cexp array }
48
48
49
49
and cexp_let =
50
50
{ let_ident : Ast .ident ;
51
- let_value : Pexp .pexp ;
51
+ let_value : Ast .pexp ;
52
52
let_body : cexp array ; }
53
53
54
54
and cexp_src =
55
55
{ src_ident : Ast .ident ;
56
- src_path : Pexp .pexp option }
56
+ src_path : Ast .pexp option }
57
57
58
58
and cexp_dir =
59
59
{ dir_ident : Ast .ident ;
60
- dir_path : Pexp .pexp option ;
60
+ dir_path : Ast .pexp option ;
61
61
dir_body : cexp array }
62
62
63
63
and cexp_use =
@@ -67,7 +67,7 @@ and cexp_use =
67
67
and cexp_nat =
68
68
{ nat_abi : string ;
69
69
nat_ident : Ast .ident ;
70
- nat_path : Pexp .pexp option ;
70
+ nat_path : Ast .pexp option ;
71
71
(*
72
72
* FIXME: possibly support embedding optional strings as
73
73
* symbol-names, to handle mangling schemes that aren't
@@ -80,7 +80,7 @@ and cexp_nat =
80
80
81
81
(* Cexp grammar. *)
82
82
83
- let parse_meta_input (ps :pstate ) : (Ast.ident * Pexp .pexp option) =
83
+ let parse_meta_input (ps :pstate ) : (Ast.ident * Ast .pexp option) =
84
84
let lab = (ctxt " meta input: label" Pexp. parse_ident ps) in
85
85
match peek ps with
86
86
EQ ->
@@ -120,7 +120,7 @@ let parse_optional_meta_pat
120
120
LPAREN -> parse_meta_pat ps
121
121
| _ ->
122
122
let apos = lexpos ps in
123
- [| (" name" , Some (span ps apos apos (Pexp .PEXP_str ident))) |]
123
+ [| (" name" , Some (span ps apos apos (Ast .PEXP_str ident))) |]
124
124
;;
125
125
126
126
let rec parse_cexps (ps :pstate ) (term :Token.token ) : cexp array =
@@ -282,7 +282,7 @@ and parse_cexp (ps:pstate) : cexp =
282
282
| _ -> raise (unexpected ps)
283
283
284
284
285
- and parse_eq_pexp_opt (ps :pstate ) : Pexp .pexp option =
285
+ and parse_eq_pexp_opt (ps :pstate ) : Ast .pexp option =
286
286
match peek ps with
287
287
EQ ->
288
288
begin
@@ -493,9 +493,9 @@ and eval_cexp (env:env) (exp:cexp) : cdir array =
493
493
| CEXP_auth a -> [| CDIR_auth a.node |]
494
494
495
495
496
- and eval_pexp (env :env ) (exp :Pexp .pexp ) : pval =
496
+ and eval_pexp (env :env ) (exp :Ast .pexp ) : pval =
497
497
match exp.node with
498
- | Pexp .PEXP_binop (bop , a , b ) ->
498
+ | Ast .PEXP_binop (bop , a , b ) ->
499
499
begin
500
500
let av = eval_pexp env a in
501
501
let bv = eval_pexp env b in
@@ -518,7 +518,7 @@ and eval_pexp (env:env) (exp:Pexp.pexp) : pval =
518
518
end
519
519
end
520
520
521
- | Pexp .PEXP_unop (uop , a ) ->
521
+ | Ast .PEXP_unop (uop , a ) ->
522
522
begin
523
523
match uop with
524
524
Ast. UNOP_not ->
@@ -528,29 +528,29 @@ and eval_pexp (env:env) (exp:Pexp.pexp) : pval =
528
528
| _ -> bug () " Unexpected unop in Cexp.eval_pexp"
529
529
end
530
530
531
- | Pexp .PEXP_lval (Pexp . PLVAL_ident ident ) ->
531
+ | Ast .PEXP_lval (Ast . PLVAL_ident ident ) ->
532
532
begin
533
533
match ltab_search ! (env.env_bindings) ident with
534
534
None -> raise (err (Printf. sprintf " no binding for '%s' found"
535
535
ident) env.env_ps)
536
536
| Some v -> v
537
537
end
538
538
539
- | Pexp .PEXP_lit (Ast. LIT_bool b ) ->
539
+ | Ast .PEXP_lit (Ast. LIT_bool b ) ->
540
540
PVAL_bool b
541
541
542
- | Pexp .PEXP_lit (Ast. LIT_int i)
543
- | Pexp .PEXP_lit (Ast. LIT_uint i)
544
- | Pexp .PEXP_lit (Ast. LIT_mach_int (_ , i )) ->
542
+ | Ast .PEXP_lit (Ast. LIT_int i)
543
+ | Ast .PEXP_lit (Ast. LIT_uint i)
544
+ | Ast .PEXP_lit (Ast. LIT_mach_int (_ , i )) ->
545
545
PVAL_num i
546
546
547
- | Pexp .PEXP_str s ->
547
+ | Ast .PEXP_str s ->
548
548
PVAL_str s
549
549
550
550
| _ -> bug () " unexpected Pexp in Cexp.eval_pexp"
551
551
552
552
553
- and eval_pexp_to_str (env :env ) (exp :Pexp .pexp ) : string =
553
+ and eval_pexp_to_str (env :env ) (exp :Ast .pexp ) : string =
554
554
match eval_pexp env exp with
555
555
PVAL_str s -> s
556
556
| v -> unexpected_val " str" v
@@ -560,10 +560,10 @@ and need_num (cv:pval) : int64 =
560
560
PVAL_num n -> n
561
561
| v -> unexpected_val " num" v
562
562
563
- and eval_pexp_to_num (env :env ) (exp :Pexp .pexp ) : int64 =
563
+ and eval_pexp_to_num (env :env ) (exp :Ast .pexp ) : int64 =
564
564
need_num (eval_pexp env exp)
565
565
566
- and eval_pexp_to_bool (env :env ) (exp :Pexp .pexp ) : bool =
566
+ and eval_pexp_to_bool (env :env ) (exp :Ast .pexp ) : bool =
567
567
match eval_pexp env exp with
568
568
PVAL_bool b -> b
569
569
| v -> unexpected_val " bool" v
0 commit comments