Mercurial > urweb
comparison src/compiler.sml @ 133:55d8cfa4d024
MonoReduce
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 17 Jul 2008 12:59:52 -0400 |
parents | 25b28625d4df |
children | 18299126a343 |
comparison
equal
deleted
inserted
replaced
132:25b28625d4df | 133:55d8cfa4d024 |
---|---|
248 if ErrorMsg.anyErrors () then | 248 if ErrorMsg.anyErrors () then |
249 NONE | 249 NONE |
250 else | 250 else |
251 SOME (Untangle.untangle file) | 251 SOME (Untangle.untangle file) |
252 | 252 |
253 fun mono_reduce job = | |
254 case untangle job of | |
255 NONE => NONE | |
256 | SOME file => | |
257 if ErrorMsg.anyErrors () then | |
258 NONE | |
259 else | |
260 SOME (MonoReduce.reduce file) | |
261 | |
253 fun mono_opt job = | 262 fun mono_opt job = |
254 case untangle job of | 263 case mono_reduce job of |
255 NONE => NONE | 264 NONE => NONE |
256 | SOME file => | 265 | SOME file => |
257 if ErrorMsg.anyErrors () then | 266 if ErrorMsg.anyErrors () then |
258 NONE | 267 NONE |
259 else | 268 else |
357 handle MonoEnv.UnboundNamed n => | 366 handle MonoEnv.UnboundNamed n => |
358 print ("Unbound named " ^ Int.toString n ^ "\n") | 367 print ("Unbound named " ^ Int.toString n ^ "\n") |
359 | 368 |
360 fun testUntangle job = | 369 fun testUntangle job = |
361 (case untangle job of | 370 (case untangle job of |
371 NONE => print "Failed\n" | |
372 | SOME file => | |
373 (Print.print (MonoPrint.p_file MonoEnv.empty file); | |
374 print "\n")) | |
375 handle MonoEnv.UnboundNamed n => | |
376 print ("Unbound named " ^ Int.toString n ^ "\n") | |
377 | |
378 fun testMono_reduce job = | |
379 (case mono_reduce job of | |
362 NONE => print "Failed\n" | 380 NONE => print "Failed\n" |
363 | SOME file => | 381 | SOME file => |
364 (Print.print (MonoPrint.p_file MonoEnv.empty file); | 382 (Print.print (MonoPrint.p_file MonoEnv.empty file); |
365 print "\n")) | 383 print "\n")) |
366 handle MonoEnv.UnboundNamed n => | 384 handle MonoEnv.UnboundNamed n => |