comparison src/compiler.sml @ 16:bc7b76ca57e0

Conversion to Core
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 13:59:29 -0400
parents f1c36df29ed7
children 1ab48e37d0ef
comparison
equal deleted inserted replaced
15:1e645beb3f3b 16:bc7b76ca57e0
64 if ErrorMsg.anyErrors () then 64 if ErrorMsg.anyErrors () then
65 NONE 65 NONE
66 else 66 else
67 SOME out 67 SOME out
68 end 68 end
69 69
70 fun corify eenv cenv filename =
71 case elaborate eenv filename of
72 NONE => NONE
73 | SOME (_, file) => SOME (Corify.corify file)
70 74
71 fun testParse filename = 75 fun testParse filename =
72 case parse filename of 76 case parse filename of
73 NONE => print "Failed\n" 77 NONE => print "Failed\n"
74 | SOME file => 78 | SOME file =>
82 (Print.print (ElabPrint.p_file ElabEnv.basis file); 86 (Print.print (ElabPrint.p_file ElabEnv.basis file);
83 print "\n")) 87 print "\n"))
84 handle ElabEnv.UnboundNamed n => 88 handle ElabEnv.UnboundNamed n =>
85 print ("Unbound named " ^ Int.toString n ^ "\n") 89 print ("Unbound named " ^ Int.toString n ^ "\n")
86 90
91 fun testCorify filename =
92 (case corify ElabEnv.basis CoreEnv.basis filename of
93 NONE => print "Failed\n"
94 | SOME file =>
95 (Print.print (CorePrint.p_file CoreEnv.basis file);
96 print "\n"))
97 handle CoreEnv.UnboundNamed n =>
98 print ("Unbound named " ^ Int.toString n ^ "\n")
99
87 end 100 end