Jonathan Graveline pushed to branch graveline at Stefan / Typer
Commits: eaca195c by Jonathan Graveline at 2018-05-26T15:23:04Z Sexp_print for debugging - - - - -
1 changed file:
- src/eval.ml
Changes:
===================================== src/eval.ml ===================================== --- a/src/eval.ml +++ b/src/eval.ml @@ -299,7 +299,15 @@ let sexp_eq loc depth args_val = match args_val with | _ -> error loc "Sexp.= expects 2 sexps"
let sexp_p loc depth args_val = match args_val with - | [Vsexp (s1)] -> print_string ("\n\t"^(sexp_string s1)^"\n\n"); Vsexp (s1) + | [Vsexp (s1)] -> (let tstr = (match s1 with + | Block _ -> "Blk" + | Symbol _ -> "Sym" + | String _ -> "Str" + | Integer _ -> "Int" + | Float _ -> "Flt" + | Node _ -> "Nod" + ) + in print_string ("\n\t"^tstr^" : ["^(sexp_string s1)^"]\n\n"); Vsexp (s1)) | _ -> error loc "Sexp.print expects 1 sexps"
let file_open loc depth args_val = match args_val with @@ -561,9 +569,9 @@ and sexp_dispatch loc depth args = rctx) | Float (_ , f) -> let rctx = ctx_flt in - eval flt (add_rte_variable None (Vfloat f) rctx) (* - | Block (_ , s, _) -> - eval blk (add_rte_variable None (o2v_list s)) *) + eval flt (add_rte_variable None (Vfloat f) rctx) + (*| Block (_ , s, _) -> + eval blk (add_rte_variable None (o2v_list s))*) | _ -> print_string "match error\n"; flush stdout; error loc "sexp_dispatch error"
View it on GitLab: https://gitlab.com/monnier/typer/commit/eaca195c1faf4141c9359e6e0dae3843e255...
Afficher les réponses par date