diff --git a/Parser.lhs b/Parser.lhs index f67104f..28f6039 100644 --- a/Parser.lhs +++ b/Parser.lhs @@ -71,7 +71,10 @@ to be. > app :: P ScalarExpr -> app = App <$> identifierString <*> parens (commaSep scalarExpr') +> app = App <$> identifierString +> -- support for count(*) +> <*> parens (choice[(:[]) <$> try star +> ,commaSep scalarExpr']) > scase :: P ScalarExpr > scase = diff --git a/TODO b/TODO index f311c09..81039ea 100644 --- a/TODO +++ b/TODO @@ -14,6 +14,8 @@ position annotation emacs parse error formatting +haddock + = sql support count(*) diff --git a/Tests.lhs b/Tests.lhs index c77f2d2..ef8bf50 100644 --- a/Tests.lhs +++ b/Tests.lhs @@ -199,7 +199,13 @@ > fullQueries :: TestItem > fullQueries = Group "queries" $ map (uncurry TestQueryExpr) -> [("select a, sum(c+d) as s\n\ +> [("select count(*) from t" +> ,makeSelect +> {qeSelectList = [(Nothing, App "count" [Star])] +> ,qeFrom = [SimpleTableRef "t"] +> } +> ) +> ,("select a, sum(c+d) as s\n\ > \ from t,u\n\ > \ where a > 5\n\ > \ group by a\n\