summaryrefslogtreecommitdiff
path: root/src/sql.sml
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2015-09-30 00:33:52 -0400
committerGravatar Ziv Scully <ziv@mit.edu>2015-09-30 00:33:52 -0400
commit36cb6a55281f753774e491cce3178eb8c927983e (patch)
treee6b85d904b4e70406e2e2c2deab62ddd527a1bfe /src/sql.sml
parent3c2143723af4a52064386104d2105137a77bd761 (diff)
Fix SQL-parsing and declaration-ordering bugs.
Diffstat (limited to 'src/sql.sml')
-rw-r--r--src/sql.sml10
1 files changed, 6 insertions, 4 deletions
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))