Skip to content

Commit f3eff89

Browse files
committed
feat(hw6): debug codes
1 parent 06d969f commit f3eff89

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

HW/HW6/eval.ml

+4-3
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,10 @@ let rec exp2string exp =
325325

326326
(* state2string : state -> string
327327
* you may modify this function for debugging your code *)
328-
let state2string st = match st with
329-
Anal_ST(_,_,exp,_) -> "Analysis : ???"
330-
| Return_ST(_,_,_) -> "Return : ??? "
328+
let state2string st =
329+
match st with
330+
| Anal_ST(_,_,exp,_) -> "Analysis : " ^ exp2string (exp)
331+
| Return_ST(_,_,valu) -> "Return : " ^ exp2string (value2exp (valu))
331332

332333
(* ------------------------------------------------------------- *)
333334
let stepOpt1 e = try Some (step1 e) with Stuck -> None

0 commit comments

Comments
 (0)