enum Stmt { SelectStmt(Box<Expr>, String, String, Option<Box<Expr>>), // dbname, tablename, keys, values InsertStmt(String, String, Vec<String>, Vec<Vec<String>>), - // dbname, tablename - DeleteStmt(String, String), + // dbname, tablename, where_clause + DeleteStmt(String, String, Option<Box<Expr>>), } diff --git a/src/parser.lalrpop b/src/parser.lalrpop @@ -12,8 +12,8 @@ pub Statement: Stmt = { Stmt::InsertStmt(fi.0, fi.1, li1, li2) }, // DELETE FROM dbname "." tablename - Delete_T From_T <fi: From_Item> => { - Stmt::DeleteStmt(fi.0, fi.1) + Delete_T From_T <fi: From_Item> <ow:OptWhere> => { + Stmt::DeleteStmt(fi.0, fi.1, ow) }, } Add where member to Node Change syntax to accept where