comparison src/sql.sml @ 2261:f81f1930c5d6

Fix SQL-parsing and declaration-ordering bugs.
author Ziv Scully <ziv@mit.edu>
date Wed, 30 Sep 2015 00:33:52 -0400
parents 565da55a4e18
children f8903af753ff
comparison
equal deleted inserted replaced
2260:03b10c7fab9a 2261:f81f1930c5d6
319 constK "SUM", 319 constK "SUM",
320 constK "AVG"] 320 constK "AVG"]
321 321
322 fun arithmetic pExp = follow (const "(") 322 fun arithmetic pExp = follow (const "(")
323 (follow pExp 323 (follow pExp
324 (follow (altL (map const [" + ", " - ", " * ", " / "])) 324 (follow (altL (map const [" + ", " - ", " * ", " / ", " >> ", " << "]))
325 (follow pExp (const ")")))) 325 (follow pExp (const ")"))))
326 326
327 val unmodeled = altL [const "COUNT(*)", 327 val unmodeled = altL [const "COUNT(*)",
328 const "CURRENT_TIMESTAMP"] 328 const "CURRENT_TIMESTAMP"]
329 329
443 handle ListPair.UnequalLengths => NONE)) 443 handle ListPair.UnequalLengths => NONE))
444 444
445 val delete = log "delete" 445 val delete = log "delete"
446 (wrap (follow (const "DELETE FROM ") 446 (wrap (follow (const "DELETE FROM ")
447 (follow uw_ident 447 (follow uw_ident
448 (follow (follow (opt (const " AS T_T")) (const " WHERE ")) 448 (follow (opt (const " AS T_T"))
449 sqexp))) 449 (opt (follow (const " WHERE ") sqexp)))))
450 (fn ((), (tab, (_, es))) => (tab, es))) 450 (fn ((), (tab, (_, wher))) => (tab, case wher of
451 SOME (_, es) => es
452 | NONE => SqTrue)))
451 453
452 val setting = log "setting" 454 val setting = log "setting"
453 (wrap (follow uw_ident (follow (const " = ") sqexp)) 455 (wrap (follow uw_ident (follow (const " = ") sqexp))
454 (fn (f, ((), e)) => (f, e))) 456 (fn (f, ((), e)) => (f, e)))
455 457