Mercurial > urweb
comparison src/core_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 | 5d030ee143e2 |
children | 19ee24bffbc0 |
comparison
equal
deleted
inserted
replaced
181:31dfab1d4050 | 182:d11754ffe252 |
---|---|
169 string ")"] | 169 string ")"] |
170 | 170 |
171 fun p_pat' par env (p, _) = | 171 fun p_pat' par env (p, _) = |
172 case p of | 172 case p of |
173 PWild => string "_" | 173 PWild => string "_" |
174 | PVar s => string s | 174 | PVar (s, _) => string s |
175 | PPrim p => Prim.p_t p | 175 | PPrim p => Prim.p_t p |
176 | PCon (n, NONE) => p_patCon env n | 176 | PCon (n, NONE) => p_patCon env n |
177 | PCon (n, SOME p) => parenIf par (box [p_patCon env n, | 177 | PCon (n, SOME p) => parenIf par (box [p_patCon env n, |
178 space, | 178 space, |
179 p_pat' true env p]) | 179 p_pat' true env p]) |
180 | PRecord xps => | 180 | PRecord xps => |
181 box [string "{", | 181 box [string "{", |
182 p_list_sep (box [string ",", space]) (fn (x, p) => | 182 p_list_sep (box [string ",", space]) (fn (x, p, _) => |
183 box [string x, | 183 box [string x, |
184 space, | 184 space, |
185 string "=", | 185 string "=", |
186 space, | 186 space, |
187 p_pat env p]) xps, | 187 p_pat env p]) xps, |