comparison src/elaborate.sml @ 821:395a5d450cc0

Chars and more string operations
author Adam Chlipala <adamc@hcoop.net>
date Tue, 26 May 2009 12:25:06 -0400
parents cb30dd2ba353
children d4e811beb8eb
comparison
equal deleted inserted replaced
820:91f465ded07e 821:395a5d450cc0
138 val strerror = (L'.StrError, dummy) 138 val strerror = (L'.StrError, dummy)
139 139
140 val int = ref cerror 140 val int = ref cerror
141 val float = ref cerror 141 val float = ref cerror
142 val string = ref cerror 142 val string = ref cerror
143 val char = ref cerror
143 val table = ref cerror 144 val table = ref cerror
144 145
145 local 146 local
146 val count = ref 0 147 val count = ref 0
147 in 148 in
1094 fun primType env p = 1095 fun primType env p =
1095 case p of 1096 case p of
1096 P.Int _ => !int 1097 P.Int _ => !int
1097 | P.Float _ => !float 1098 | P.Float _ => !float
1098 | P.String _ => !string 1099 | P.String _ => !string
1100 | P.Char _ => !char
1099 1101
1100 datatype constraint = 1102 datatype constraint =
1101 Disjoint of D.goal 1103 Disjoint of D.goal
1102 | TypeClass of E.env * L'.con * L'.exp option ref * ErrorMsg.span 1104 | TypeClass of E.env * L'.con * L'.exp option ref * ErrorMsg.span
1103 1105
3972 | E.Named (n, (_, loc)) => r := (L'.CNamed n, loc) 3974 | E.Named (n, (_, loc)) => r := (L'.CNamed n, loc)
3973 3975
3974 val () = discoverC int "int" 3976 val () = discoverC int "int"
3975 val () = discoverC float "float" 3977 val () = discoverC float "float"
3976 val () = discoverC string "string" 3978 val () = discoverC string "string"
3979 val () = discoverC char "char"
3977 val () = discoverC table "sql_table" 3980 val () = discoverC table "sql_table"
3978 3981
3979 val (topSgn, gs) = elabSgn (env', D.empty) (L.SgnConst topSgn, ErrorMsg.dummySpan) 3982 val (topSgn, gs) = elabSgn (env', D.empty) (L.SgnConst topSgn, ErrorMsg.dummySpan)
3980 val () = case gs of 3983 val () = case gs of
3981 [] => () 3984 [] => ()