Mercurial > urweb
comparison src/compiler.sml @ 20:1ab48e37d0ef
Some con reducing
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 08 Jun 2008 15:47:44 -0400 |
parents | bc7b76ca57e0 |
children | bfa2e9ae4df8 |
comparison
equal
deleted
inserted
replaced
19:e634ae817a8e | 20:1ab48e37d0ef |
---|---|
70 fun corify eenv cenv filename = | 70 fun corify eenv cenv filename = |
71 case elaborate eenv filename of | 71 case elaborate eenv filename of |
72 NONE => NONE | 72 NONE => NONE |
73 | SOME (_, file) => SOME (Corify.corify file) | 73 | SOME (_, file) => SOME (Corify.corify file) |
74 | 74 |
75 fun reduce eenv cenv filename = | |
76 case corify eenv cenv filename of | |
77 NONE => NONE | |
78 | SOME file => SOME (Reduce.reduce file) | |
79 | |
75 fun testParse filename = | 80 fun testParse filename = |
76 case parse filename of | 81 case parse filename of |
77 NONE => print "Failed\n" | 82 NONE => print "Failed\n" |
78 | SOME file => | 83 | SOME file => |
79 (Print.print (SourcePrint.p_file file); | 84 (Print.print (SourcePrint.p_file file); |
95 (Print.print (CorePrint.p_file CoreEnv.basis file); | 100 (Print.print (CorePrint.p_file CoreEnv.basis file); |
96 print "\n")) | 101 print "\n")) |
97 handle CoreEnv.UnboundNamed n => | 102 handle CoreEnv.UnboundNamed n => |
98 print ("Unbound named " ^ Int.toString n ^ "\n") | 103 print ("Unbound named " ^ Int.toString n ^ "\n") |
99 | 104 |
105 fun testReduce filename = | |
106 (case reduce ElabEnv.basis CoreEnv.basis filename of | |
107 NONE => print "Failed\n" | |
108 | SOME file => | |
109 (Print.print (CorePrint.p_file CoreEnv.basis file); | |
110 print "\n")) | |
111 handle CoreEnv.UnboundNamed n => | |
112 print ("Unbound named " ^ Int.toString n ^ "\n") | |
113 | |
100 end | 114 end |