Mercurial > urweb
comparison src/mono_print.sml @ 182:d11754ffe252
Compiled pattern matching to C
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 03 Aug 2008 12:43:20 -0400 |
parents | 3bbed533fbd2 |
children | c0ea24dcb86f |
comparison
equal
deleted
inserted
replaced
181:31dfab1d4050 | 182:d11754ffe252 |
---|---|
87 string ")"] | 87 string ")"] |
88 | 88 |
89 fun p_pat' par env (p, _) = | 89 fun p_pat' par env (p, _) = |
90 case p of | 90 case p of |
91 PWild => string "_" | 91 PWild => string "_" |
92 | PVar s => string s | 92 | PVar (s, _) => string s |
93 | PPrim p => Prim.p_t p | 93 | PPrim p => Prim.p_t p |
94 | PCon (n, NONE) => p_patCon env n | 94 | PCon (n, NONE) => p_patCon env n |
95 | PCon (n, SOME p) => parenIf par (box [p_patCon env n, | 95 | PCon (n, SOME p) => parenIf par (box [p_patCon env n, |
96 space, | 96 space, |
97 p_pat' true env p]) | 97 p_pat' true env p]) |
98 | PRecord xps => | 98 | PRecord xps => |
99 box [string "{", | 99 box [string "{", |
100 p_list_sep (box [string ",", space]) (fn (x, p) => | 100 p_list_sep (box [string ",", space]) (fn (x, p, _) => |
101 box [string x, | 101 box [string x, |
102 space, | 102 space, |
103 string "=", | 103 string "=", |
104 space, | 104 space, |
105 p_pat env p]) xps, | 105 p_pat env p]) xps, |