From 7f08e51c740f6dbc75146107bab72059fd340c93 Mon Sep 17 00:00:00 2001 From: Jake Wheat Date: Mon, 22 Feb 2016 23:28:59 +0200 Subject: [PATCH] add comments to statement syntax --- Language/SQL/SimpleSQL/Pretty.lhs | 3 +++ Language/SQL/SimpleSQL/Syntax.lhs | 1 + TODO | 8 +++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Language/SQL/SimpleSQL/Pretty.lhs b/Language/SQL/SimpleSQL/Pretty.lhs index 0673f29..eff2a87 100644 --- a/Language/SQL/SimpleSQL/Pretty.lhs +++ b/Language/SQL/SimpleSQL/Pretty.lhs @@ -628,6 +628,9 @@ which have been changed to try to improve the layout of the output. > adminOptFor NoAdminOptionFor = empty +> statement _ (StatementComment cs) = vcat $ map comment cs + + == sessions diff --git a/Language/SQL/SimpleSQL/Syntax.lhs b/Language/SQL/SimpleSQL/Syntax.lhs index b92cf38..fc75f16 100644 --- a/Language/SQL/SimpleSQL/Syntax.lhs +++ b/Language/SQL/SimpleSQL/Syntax.lhs @@ -537,6 +537,7 @@ I'm not sure if this is valid syntax or not. > | SetNames > | SetTransform > | SetCollation -} +> | StatementComment [Comment] > deriving (Eq,Show,Read,Data,Typeable) > data DropBehaviour = diff --git a/TODO b/TODO index ea759e6..fda14b3 100644 --- a/TODO +++ b/TODO @@ -1,16 +1,14 @@ medium tasks next release -rename combinequeryexpr -add comment to statements? -review simple enums to make sure they have default - use enum in sign in interval literal - syntax from hssqlppp: query hints, join hints unescaping identifiers and strings continuation strings testing +add tests for comment pretty printing: + use pretty then lex + work on better dialect design: more basic customizability and rule / callback driven