comparison src/compiler.sml @ 131:5df655503288

Untangle
author Adam Chlipala <adamc@hcoop.net>
date Thu, 17 Jul 2008 12:19:44 -0400
parents 0644d3c3bedf
children 25b28625d4df
comparison
equal deleted inserted replaced
130:96bd3350e77d 131:5df655503288
230 if ErrorMsg.anyErrors () then 230 if ErrorMsg.anyErrors () then
231 NONE 231 NONE
232 else 232 else
233 SOME (Monoize.monoize CoreEnv.empty file) 233 SOME (Monoize.monoize CoreEnv.empty file)
234 234
235 fun untangle job =
236 case monoize job of
237 NONE => NONE
238 | SOME file =>
239 if ErrorMsg.anyErrors () then
240 NONE
241 else
242 SOME (Untangle.untangle file)
243
235 fun mono_opt job = 244 fun mono_opt job =
236 case monoize job of 245 case untangle job of
237 NONE => NONE 246 NONE => NONE
238 | SOME file => 247 | SOME file =>
239 if ErrorMsg.anyErrors () then 248 if ErrorMsg.anyErrors () then
240 NONE 249 NONE
241 else 250 else
302 print "\n")) 311 print "\n"))
303 handle CoreEnv.UnboundNamed n => 312 handle CoreEnv.UnboundNamed n =>
304 print ("Unbound named " ^ Int.toString n ^ "\n") 313 print ("Unbound named " ^ Int.toString n ^ "\n")
305 314
306 fun testReduce job = 315 fun testReduce job =
307 (case reduce job of 316 (case tag job of
308 NONE => print "Failed\n" 317 NONE => print "Failed\n"
309 | SOME file => 318 | SOME file =>
310 (Print.print (CorePrint.p_file CoreEnv.empty file); 319 (Print.print (CorePrint.p_file CoreEnv.empty file);
311 print "\n")) 320 print "\n"))
312 handle CoreEnv.UnboundNamed n => 321 handle CoreEnv.UnboundNamed n =>
321 handle CoreEnv.UnboundNamed n => 330 handle CoreEnv.UnboundNamed n =>
322 print ("Unbound named " ^ Int.toString n ^ "\n") 331 print ("Unbound named " ^ Int.toString n ^ "\n")
323 332
324 fun testMonoize job = 333 fun testMonoize job =
325 (case monoize job of 334 (case monoize job of
335 NONE => print "Failed\n"
336 | SOME file =>
337 (Print.print (MonoPrint.p_file MonoEnv.empty file);
338 print "\n"))
339 handle MonoEnv.UnboundNamed n =>
340 print ("Unbound named " ^ Int.toString n ^ "\n")
341
342 fun testUntangle job =
343 (case untangle job of
326 NONE => print "Failed\n" 344 NONE => print "Failed\n"
327 | SOME file => 345 | SOME file =>
328 (Print.print (MonoPrint.p_file MonoEnv.empty file); 346 (Print.print (MonoPrint.p_file MonoEnv.empty file);
329 print "\n")) 347 print "\n"))
330 handle MonoEnv.UnboundNamed n => 348 handle MonoEnv.UnboundNamed n =>