46 |
fun sp () = PP.space ppStrm 1 |
fun sp () = PP.space ppStrm 1 |
47 |
val string = PP.string ppStrm |
val string = PP.string ppStrm |
48 |
fun var x = string(Var.nameOf x) |
fun var x = string(Var.nameOf x) |
49 |
|
fun ppIndex (ppStrm, NONE) = PP.string ppStrm ":" |
50 |
|
| ppIndex (ppStrm, SOME e) = ppExp (ppStrm, e) |
51 |
fun pp e = (case e |
fun pp e = (case e |
52 |
of AST.E_Var x => var x |
of AST.E_Var x => var x |
53 |
| AST.E_Lit lit => string (Literal.toString lit) |
| AST.E_Lit lit => string (Literal.toString lit) |
57 |
var f; ppTyArgs (ppStrm, mvs); sp(); ppArgs (ppStrm, args)) |
var f; ppTyArgs (ppStrm, mvs); sp(); ppArgs (ppStrm, args)) |
58 |
| AST.E_Cons es => ( |
| AST.E_Cons es => ( |
59 |
ppList ppExp ("[", ",", "]") (ppStrm, es)) |
ppList ppExp ("[", ",", "]") (ppStrm, es)) |
60 |
|
| AST.E_Slice(e, indices) => ( |
61 |
|
pp e; |
62 |
|
ppList ppIndex ("[", ",", "]") (ppStrm, indices)) |
63 |
| AST.E_Cond(e1, e2, e3) => ( |
| AST.E_Cond(e1, e2, e3) => ( |
64 |
pp e1; sp(); string "?"; sp(); pp e2; sp(); string ":"; sp(); pp e3) |
pp e1; sp(); string "?"; sp(); pp e2; sp(); string ":"; sp(); pp e3) |
65 |
(* end case *)) |
(* end case *)) |