comparison src/compiler.sml @ 23:bfa2e9ae4df8

Tree-shaking
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 17:15:09 -0400
parents 1ab48e37d0ef
children ea15905e598d
comparison
equal deleted inserted replaced
22:d8850cc06d24 23:bfa2e9ae4df8
75 fun reduce eenv cenv filename = 75 fun reduce eenv cenv filename =
76 case corify eenv cenv filename of 76 case corify eenv cenv filename of
77 NONE => NONE 77 NONE => NONE
78 | SOME file => SOME (Reduce.reduce file) 78 | SOME file => SOME (Reduce.reduce file)
79 79
80 fun shake eenv cenv filename =
81 case reduce eenv cenv filename of
82 NONE => NONE
83 | SOME file => SOME (Shake.shake file)
84
80 fun testParse filename = 85 fun testParse filename =
81 case parse filename of 86 case parse filename of
82 NONE => print "Failed\n" 87 NONE => print "Failed\n"
83 | SOME file => 88 | SOME file =>
84 (Print.print (SourcePrint.p_file file); 89 (Print.print (SourcePrint.p_file file);
109 (Print.print (CorePrint.p_file CoreEnv.basis file); 114 (Print.print (CorePrint.p_file CoreEnv.basis file);
110 print "\n")) 115 print "\n"))
111 handle CoreEnv.UnboundNamed n => 116 handle CoreEnv.UnboundNamed n =>
112 print ("Unbound named " ^ Int.toString n ^ "\n") 117 print ("Unbound named " ^ Int.toString n ^ "\n")
113 118
119 fun testShake filename =
120 (case shake ElabEnv.basis CoreEnv.basis filename of
121 NONE => print "Failed\n"
122 | SOME file =>
123 (Print.print (CorePrint.p_file CoreEnv.basis file);
124 print "\n"))
125 handle CoreEnv.UnboundNamed n =>
126 print ("Unbound named " ^ Int.toString n ^ "\n")
127
114 end 128 end