1
Fork 0

change joins so natural is represented by separate field to on/using

some fixes and tweaks to the reserved keyword handling, especially in
  the typename parser
This commit is contained in:
Jake Wheat 2014-04-19 11:18:29 +03:00
parent 5d9a32a91d
commit fea6e347bd
7 changed files with 73 additions and 51 deletions
Language/SQL/SimpleSQL

View file

@ -366,15 +366,13 @@ which have been changed to try to improve the layout of the output.
> tr (TRAlias t a) = sep [tr t, alias a]
> tr (TRParens t) = parens $ tr t
> tr (TRQueryExpr q) = parens $ queryExpr q
> tr (TRJoin t0 jt t1 jc) =
> tr (TRJoin t0 b jt t1 jc) =
> sep [tr t0
> ,joinText jt jc <+> tr t1
> ,if b then text "natural" else empty
> ,joinText jt <+> tr t1
> ,joinCond jc]
> joinText jt jc =
> sep [case jc of
> Just JoinNatural -> text "natural"
> _ -> empty
> ,case jt of
> joinText jt =
> sep [case jt of
> JInner -> text "inner"
> JLeft -> text "left"
> JRight -> text "right"
@ -385,7 +383,6 @@ which have been changed to try to improve the layout of the output.
> joinCond (Just (JoinUsing es)) =
> text "using" <+> parens (commaSep $ map name es)
> joinCond Nothing = empty
> joinCond (Just JoinNatural) = empty
> maybeValueExpr :: String -> Maybe ValueExpr -> Doc
> maybeValueExpr k = me