]> gitweb.factorcode.org Git - factor.git/commitdiff
db.sqlite.errors: simplify implementation
authorAlexander Iljin <ajsoft@yandex.ru>
Sat, 20 Feb 2016 17:07:42 +0000 (21:07 +0400)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 29 Jun 2016 21:17:57 +0000 (14:17 -0700)
basis/db/sqlite/errors/errors.factor

index 1e5da3ca948c39f069a750d097c1eb7b89a7c3e9..ca55c3a8ca4e04a3711a9a4fda6ea17c34500ffb 100644 (file)
@@ -7,20 +7,13 @@ IN: db.sqlite.errors
 TUPLE: unparsed-sqlite-error error ;
 C: <unparsed-sqlite-error> unparsed-sqlite-error
 
-SINGLETONS: table-exists table-missing ;
-
-: sqlite-table-error ( table message -- error )
-    {
-        { table-exists [ <sql-table-exists> ] }
-    } case ;
-
 EBNF: parse-sqlite-sql-error
 
-TableMessage = " already exists" => [[ table-exists ]]
+AlreadyExists = " already exists"
 
 SqliteError =
-    "table " (!(TableMessage).)+:table TableMessage:message
-      => [[ table >string message sqlite-table-error ]]
+    "table " (!(AlreadyExists).)+:table AlreadyExists
+      => [[ table >string <sql-table-exists> ]]
     | "no such table: " .+:table
       => [[ table >string <sql-table-missing> ]]
     | .*:error