diff --git a/Language/SQL/SimpleSQL/Parser.lhs b/Language/SQL/SimpleSQL/Parser.lhs index da120cf..c29e312 100644 --- a/Language/SQL/SimpleSQL/Parser.lhs +++ b/Language/SQL/SimpleSQL/Parser.lhs @@ -312,7 +312,6 @@ keyword. > binOpMultiKeywordNames :: [[String]] > binOpMultiKeywordNames = map words > ["not like" -> ,"not similar" > ,"is similar to" > ,"is not similar to" > ,"is distinct from" @@ -353,6 +352,10 @@ The parsers: > opSymbol = choice (map (try . symbol) prefixUnOpSymbolNames > ++ map (try . keyword) prefixUnOpKeywordNames) +TODO: the handling of multikeyword args is different in +postfixopsuffix and binaryoperatorsuffix. It should be the same in +both cases + > postfixOpSuffix :: ScalarExpr -> P ScalarExpr > postfixOpSuffix e = > try $ choice $ map makeOp opPairs @@ -463,9 +466,6 @@ expression tree (for efficiency and code clarity). = query expressions -TODO: maybe refactor all the parsers. A parser wouldn't usually be -optional or use try itself. The caller could do this. - == select lists > selectItem :: P (Maybe String, ScalarExpr) diff --git a/Language/SQL/SimpleSQL/Pretty.lhs b/Language/SQL/SimpleSQL/Pretty.lhs index 7d85fb4..5d7a022 100644 --- a/Language/SQL/SimpleSQL/Pretty.lhs +++ b/Language/SQL/SimpleSQL/Pretty.lhs @@ -1,7 +1,4 @@ -This is the pretty printer code which takes AST values and turns them -back into SQL source text. It attempts to format the output nicely. - > -- | These is the pretty printing functions, which produce SQL > -- source from ASTs. The code attempts to format the output in a > -- readable way. diff --git a/README b/README index 53efe23..1e34418 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ A parser for SQL queries in Haskell. -Homepage: https://github.com/JakeWheat/simple_sql_parser +Homepage: http://jakewheat.github.io/simple_sql_parser/ Contact: jakewheatmail@gmail.com \ No newline at end of file diff --git a/TODO b/TODO index f959723..fae1443 100644 --- a/TODO +++ b/TODO @@ -2,15 +2,16 @@ first release: add automated tests to cabal -check the order of exports, imports and functions/cases in the files -fix up the import namespaces/explicit names nicely -do some tests for parse errors? -website with haddock and table of parsing tests ---- Later general tasks: +check the order of exports, imports and functions/cases in the files +fix up the import namespaces/explicit names nicely + +do some tests for parse errors? + dialect switching left factor parsing code in remaining places diff --git a/Tests.lhs b/Tests.lhs index ea48b80..d0edb97 100644 --- a/Tests.lhs +++ b/Tests.lhs @@ -1,5 +1,5 @@ -> module Tests (testData, runTests) where +> module Tests (testData, TestItem(..), runTests) where > import Language.SQL.SimpleSQL.Syntax > import Language.SQL.SimpleSQL.Pretty diff --git a/simple-sql-parser.cabal b/simple-sql-parser.cabal index b234247..a781e1c 100644 --- a/simple-sql-parser.cabal +++ b/simple-sql-parser.cabal @@ -2,10 +2,6 @@ name: simple-sql-parser version: 0.1.0.0 synopsis: A parser for SQL queries -description: A parser for SQL queries, using Parsec. Also includes - pretty printer. Aims to support most of SQL:2003 - queries plus other SQL dialects. - homepage: https://github.com/JakeWheat/simple_sql_parser license: BSD3 license-file: LICENSE