comparison src/cjrize.sml @ 288:4260ad920c36

Converting string to int
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 11:33:13 -0400
parents c0e4ac23522d
children df00701f2323
comparison
equal deleted inserted replaced
287:3ed7a7c7b060 288:4260ad920c36
109 in 109 in
110 r := xncs; 110 r := xncs;
111 ((L'.TDatatype (dk, n, r), loc), sm) 111 ((L'.TDatatype (dk, n, r), loc), sm)
112 end) 112 end)
113 | L.TFfi mx => ((L'.TFfi mx, loc), sm) 113 | L.TFfi mx => ((L'.TFfi mx, loc), sm)
114 | L.TOption t =>
115 let
116 val (t, sm) = cify dtmap (t, sm)
117 in
118 ((L'.TOption t, loc), sm)
119 end
114 in 120 in
115 cify IM.empty x 121 cify IM.empty x
116 end 122 end
117 123
118 val dummye = (L'.EPrim (Prim.Int 0), ErrorMsg.dummySpan) 124 val dummye = (L'.EPrim (Prim.Int 0), ErrorMsg.dummySpan)
168 ((x, p, t), sm) 174 ((x, p, t), sm)
169 end) sm xps 175 end) sm xps
170 in 176 in
171 ((L'.PRecord xps, loc), sm) 177 ((L'.PRecord xps, loc), sm)
172 end 178 end
179 | L.PNone t =>
180 let
181 val (t, sm) = cifyTyp (t, sm)
182 in
183 ((L'.PNone t, loc), sm)
184 end
185 | L.PSome (t, p) =>
186 let
187 val (t, sm) = cifyTyp (t, sm)
188 val (p, sm) = cifyPat (p, sm)
189 in
190 ((L'.PSome (t, p), loc), sm)
191 end
192
173 193
174 fun cifyExp (eAll as (e, loc), sm) = 194 fun cifyExp (eAll as (e, loc), sm) =
175 case e of 195 case e of
176 L.EPrim p => ((L'.EPrim p, loc), sm) 196 L.EPrim p => ((L'.EPrim p, loc), sm)
177 | L.ERel n => ((L'.ERel n, loc), sm) 197 | L.ERel n => ((L'.ERel n, loc), sm)