comparison src/urweb.grm @ 441:c5335613f31e

CURRENT_TIMESTAMP
author Adam Chlipala <adamc@hcoop.net>
date Thu, 30 Oct 2008 15:33:28 -0400
parents c471345f5165
children dfc8c991abd0
comparison
equal deleted inserted replaced
440:19d7f79cd584 441:c5335613f31e
152 val e = (EApp (e, sqlexp1), loc) 152 val e = (EApp (e, sqlexp1), loc)
153 in 153 in
154 (EApp (e, sqlexp2), loc) 154 (EApp (e, sqlexp2), loc)
155 end 155 end
156 156
157 fun sql_nfunc (oper, loc) =
158 let
159 val e = (EVar (["Basis"], "sql_nfunc", Infer), loc)
160 in
161 (EApp (e, (EVar (["Basis"], "sql_" ^ oper, Infer), loc)), loc)
162 end
163
157 fun native_unop (oper, e1, loc) = 164 fun native_unop (oper, e1, loc) =
158 let 165 let
159 val e = (EVar (["Basis"], oper, Infer), loc) 166 val e = (EVar (["Basis"], oper, Infer), loc)
160 in 167 in
161 (EApp (e, e1), loc) 168 (EApp (e, e1), loc)
204 | LIMIT | OFFSET | ALL 211 | LIMIT | OFFSET | ALL
205 | TRUE | FALSE | CAND | OR | NOT 212 | TRUE | FALSE | CAND | OR | NOT
206 | COUNT | AVG | SUM | MIN | MAX 213 | COUNT | AVG | SUM | MIN | MAX
207 | ASC | DESC 214 | ASC | DESC
208 | INSERT | INTO | VALUES | UPDATE | SET | DELETE 215 | INSERT | INTO | VALUES | UPDATE | SET | DELETE
216 | CURRENT_TIMESTAMP
209 | NE | LT | LE | GT | GE 217 | NE | LT | LE | GT | GE
210 218
211 %nonterm 219 %nonterm
212 file of decl list 220 file of decl list
213 | decls of decl list 221 | decls of decl list
1167 s (INTleft, INTright))) 1175 s (INTleft, INTright)))
1168 | FLOAT (sql_inject (EPrim (Prim.Float FLOAT), 1176 | FLOAT (sql_inject (EPrim (Prim.Float FLOAT),
1169 s (FLOATleft, FLOATright))) 1177 s (FLOATleft, FLOATright)))
1170 | STRING (sql_inject (EPrim (Prim.String STRING), 1178 | STRING (sql_inject (EPrim (Prim.String STRING),
1171 s (STRINGleft, STRINGright))) 1179 s (STRINGleft, STRINGright)))
1180 | CURRENT_TIMESTAMP (sql_nfunc ("current_timestamp",
1181 s (CURRENT_TIMESTAMPleft, CURRENT_TIMESTAMPright)))
1172 1182
1173 | tident DOT fident (let 1183 | tident DOT fident (let
1174 val loc = s (tidentleft, fidentright) 1184 val loc = s (tidentleft, fidentright)
1175 val e = (EVar (["Basis"], "sql_field", Infer), loc) 1185 val e = (EVar (["Basis"], "sql_field", Infer), loc)
1176 val e = (ECApp (e, tident), loc) 1186 val e = (ECApp (e, tident), loc)