From 96118854481ab9590b0100d81980c15506c1ba73 Mon Sep 17 00:00:00 2001 From: Jake Wheat Date: Tue, 31 Dec 2013 12:20:07 +0200 Subject: [PATCH] update changelog, small haddock fixes --- Language/SQL/SimpleSQL/Parser.lhs | 13 +++++++++---- Language/SQL/SimpleSQL/Pretty.lhs | 3 +++ changelog | 9 ++++++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Language/SQL/SimpleSQL/Parser.lhs b/Language/SQL/SimpleSQL/Parser.lhs index 5e7a93b..eabb28a 100644 --- a/Language/SQL/SimpleSQL/Parser.lhs +++ b/Language/SQL/SimpleSQL/Parser.lhs @@ -30,18 +30,20 @@ The public API functions. > parseQueryExpr :: FilePath > -- ^ filename to use in errors > -> Maybe (Int,Int) -> -- ^ line number and column number to use in errors +> -- ^ line number and column number of the first character +> -- in the source (to use in errors) > -> String > -- ^ the SQL source to parse > -> Either ParseError QueryExpr > parseQueryExpr = wrapParse topLevelQueryExpr -> -- | Parses a list of query exprs, with semi colons between +> -- | Parses a list of query expressions, with semi colons between > -- them. The final semicolon is optional. > parseQueryExprs :: FilePath > -- ^ filename to use in errors > -> Maybe (Int,Int) -> -- ^ line number and column number to use in errors +> -- ^ line number and column number of the first character +> -- in the source (to use in errors) > -> String > -- ^ the SQL source to parse > -> Either ParseError [QueryExpr] @@ -51,7 +53,8 @@ The public API functions. > parseValueExpr :: FilePath > -- ^ filename to use in errors > -> Maybe (Int,Int) -> -- ^ line number and column number to use in errors +> -- ^ line number and column number of the first character +> -- in the source (to use in errors) > -> String > -- ^ the SQL source to parse > -> Either ParseError ValueExpr @@ -476,6 +479,8 @@ unary prefix, unary postfix and binary infix operators. The operators can be symbols (a + b), single keywords (a and b) or multiple keywords (a is similar to b). +TODO: carefully review the precedences and associativities. + > opTable :: Bool -> [[E.Operator String () Identity ValueExpr]] > opTable bExpr = > [[binarySym "." E.AssocLeft] diff --git a/Language/SQL/SimpleSQL/Pretty.lhs b/Language/SQL/SimpleSQL/Pretty.lhs index a87586b..85d5f5f 100644 --- a/Language/SQL/SimpleSQL/Pretty.lhs +++ b/Language/SQL/SimpleSQL/Pretty.lhs @@ -8,6 +8,9 @@ > ,prettyQueryExprs > ) where +TODO: there should be more comments in this file, especially the bits +which have been changed to try to improve the layout of the output. + > import Language.SQL.SimpleSQL.Syntax > import Text.PrettyPrint (render, vcat, text, (<>), (<+>), empty, parens, > nest, Doc, punctuate, comma, sep, quotes, diff --git a/changelog b/changelog index 29385be..01ec1e7 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,8 @@ -0.3.0-dev (commit 3b2730fd9962b9a51ad659191ac842364dab86b4) +0.3.0-dev (commit 9e75fa93650b4f1a08d94f4225a243bcc50445ae) + fix the basic operator fixity parsing + swap the order in select item abstract syntax so it is now + (expression, alias) which matches the order in the concrete + syntax rename ScalarExpr -> ValueExpr rename Duplicates to SetQuantifier rename qeDuplicates to qeSetQuantifier @@ -29,6 +33,9 @@ bit varying rename tools/PrettyIt to tools/SQLIdent and add to cabal file as optional executable (disabled by default) + rename the qeFetch field in Select to qeFetchFirst + change the pretty printer to use 'fetch first' instead of + 'fetch next' 0.2.0 (commit 9ea29c1a0ceb2c3f3157fb161d1ea819ea5d64d4) '' quotes in string literal