@@ -303,7 +303,7 @@ and parse_eq_pexp_opt (ps:pstate) : Ast.pexp option =
303
303
304
304
type pval =
305
305
PVAL_str of string
306
- | PVAL_num of int64
306
+ | PVAL_int of int64
307
307
| PVAL_bool of bool
308
308
;;
309
309
@@ -325,7 +325,7 @@ let unexpected_val (expected:string) (v:pval) =
325
325
let got =
326
326
match v with
327
327
PVAL_str s -> " str \" " ^ (String. escaped s) ^ " \" "
328
- | PVAL_num i -> " num " ^ (Int64. to_string i)
328
+ | PVAL_int i -> " int " ^ (Int64. to_string i)
329
329
| PVAL_bool b -> if b then " bool true" else " bool false"
330
330
in
331
331
(* FIXME (issue #70): proper error reporting, please. *)
@@ -494,9 +494,9 @@ and eval_pexp (env:env) (exp:Ast.pexp) : pval =
494
494
(Ast. BINOP_add, PVAL_str az , PVAL_str bz ) ->
495
495
PVAL_str (az ^ bz)
496
496
| _ ->
497
- let av = (need_num av) in
498
- let bv = (need_num bv) in
499
- PVAL_num
497
+ let av = (need_int av) in
498
+ let bv = (need_int bv) in
499
+ PVAL_int
500
500
begin
501
501
match bop with
502
502
Ast. BINOP_add -> Int64. add av bv
@@ -515,7 +515,7 @@ and eval_pexp (env:env) (exp:Ast.pexp) : pval =
515
515
Ast. UNOP_not ->
516
516
PVAL_bool (not (eval_pexp_to_bool env a))
517
517
| Ast. UNOP_neg ->
518
- PVAL_num (Int64. neg (eval_pexp_to_num env a))
518
+ PVAL_int (Int64. neg (eval_pexp_to_int env a))
519
519
| _ -> bug () " Unexpected unop in Cexp.eval_pexp"
520
520
end
521
521
@@ -530,10 +530,8 @@ and eval_pexp (env:env) (exp:Ast.pexp) : pval =
530
530
| Ast. PEXP_lit (Ast. LIT_bool b ) ->
531
531
PVAL_bool b
532
532
533
- | Ast. PEXP_lit (Ast. LIT_int i)
534
- | Ast. PEXP_lit (Ast. LIT_uint i)
535
- | Ast. PEXP_lit (Ast. LIT_mach_int (_ , i )) ->
536
- PVAL_num i
533
+ | Ast. PEXP_lit (Ast. LIT_int i ) ->
534
+ PVAL_int i
537
535
538
536
| Ast. PEXP_str s ->
539
537
PVAL_str s
@@ -546,13 +544,13 @@ and eval_pexp_to_str (env:env) (exp:Ast.pexp) : string =
546
544
PVAL_str s -> s
547
545
| v -> unexpected_val " str" v
548
546
549
- and need_num (cv :pval ) : int64 =
547
+ and need_int (cv :pval ) : int64 =
550
548
match cv with
551
- PVAL_num n -> n
552
- | v -> unexpected_val " num " v
549
+ PVAL_int n -> n
550
+ | v -> unexpected_val " int " v
553
551
554
- and eval_pexp_to_num (env :env ) (exp :Ast.pexp ) : int64 =
555
- need_num (eval_pexp env exp)
552
+ and eval_pexp_to_int (env :env ) (exp :Ast.pexp ) : int64 =
553
+ need_int (eval_pexp env exp)
556
554
557
555
and eval_pexp_to_bool (env :env ) (exp :Ast.pexp ) : bool =
558
556
match eval_pexp env exp with
@@ -655,7 +653,7 @@ let parse_crate_file
655
653
ident) ps)
656
654
| Some (PVAL_bool b ) -> LIT_BOOL b
657
655
| Some (PVAL_str s ) -> LIT_STR s
658
- | Some (PVAL_num n ) -> LIT_INT n
656
+ | Some (PVAL_int n ) -> LIT_INT n
659
657
in
660
658
let ps =
661
659
make_parser crate_cache sess get_mod get_cenv_tok
0 commit comments