summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-17 09:25:03 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-17 09:25:03 -0400
commit730ead608f04d4306a782cc5c3a895557de46274 (patch)
treed1dfd2941652183729757ea8648d7e598a5ae3b2 /src
parent24f99305fcda201f67c8de846bb2d683011099b7 (diff)
Print char patterns in C
Diffstat (limited to 'src')
-rw-r--r--src/cjr_print.sml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index 538e53f2..9f337b5b 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -193,6 +193,19 @@ fun p_pat (env, exit, depth) (p, loc) =
space,
exit],
env)
+ | PPrim (Prim.Char ch) =>
+ (box [string "if",
+ space,
+ string "(disc",
+ string (Int.toString depth),
+ space,
+ string "!=",
+ space,
+ Prim.p_t_GCC (Prim.Char ch),
+ string ")",
+ space,
+ exit],
+ env)
| PPrim _ => raise Fail "CjrPrint: Disallowed PPrim primitive"
| PCon (dk, pc, po) =>