From 36cb6a55281f753774e491cce3178eb8c927983e Mon Sep 17 00:00:00 2001 From: Ziv Scully Date: Wed, 30 Sep 2015 00:33:52 -0400 Subject: Fix SQL-parsing and declaration-ordering bugs. --- src/sql.sml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/sql.sml') diff --git a/src/sql.sml b/src/sql.sml index da0143b7..08315a16 100644 --- a/src/sql.sml +++ b/src/sql.sml @@ -321,7 +321,7 @@ val funcName = altL [constK "COUNT", fun arithmetic pExp = follow (const "(") (follow pExp - (follow (altL (map const [" + ", " - ", " * ", " / "])) + (follow (altL (map const [" + ", " - ", " * ", " / ", " >> ", " << "])) (follow pExp (const ")")))) val unmodeled = altL [const "COUNT(*)", @@ -445,9 +445,11 @@ val insert = log "insert" val delete = log "delete" (wrap (follow (const "DELETE FROM ") (follow uw_ident - (follow (follow (opt (const " AS T_T")) (const " WHERE ")) - sqexp))) - (fn ((), (tab, (_, es))) => (tab, es))) + (follow (opt (const " AS T_T")) + (opt (follow (const " WHERE ") sqexp))))) + (fn ((), (tab, (_, wher))) => (tab, case wher of + SOME (_, es) => es + | NONE => SqTrue))) val setting = log "setting" (wrap (follow uw_ident (follow (const " = ") sqexp)) -- cgit v1.2.3