fix some imports and exports, particularly stop reexporting all the dialect stuff everywhere
This commit is contained in:
parent
f58e19f33b
commit
9df04a3040
|
@ -24,8 +24,8 @@ directly without the separately testing lexing stage.
|
|||
> ,prettyToken
|
||||
> ,prettyTokens
|
||||
> ,ParseError(..)
|
||||
> ,Dialect(..)
|
||||
> ,tokenListWillPrintAndLex
|
||||
> ,ansi2011
|
||||
> ) where
|
||||
|
||||
> import Language.SQL.SimpleSQL.Dialect
|
||||
|
|
|
@ -192,20 +192,21 @@ fixing them in the syntax but leaving them till the semantic checking
|
|||
> ,try,many,many1,(<|>),choice,eof
|
||||
> ,optionMaybe,optional,runParser
|
||||
> ,chainl1, chainr1,(<?>))
|
||||
> -- import Text.Parsec.String (Parser)
|
||||
> import Text.Parsec.Perm (permute,(<$?>), (<|?>))
|
||||
> import Text.Parsec.Prim (getState, token)
|
||||
> import Text.Parsec.Pos (newPos)
|
||||
> import qualified Text.Parsec.Expr as E
|
||||
> import Data.List (intercalate,sort,groupBy)
|
||||
> import Data.Function (on)
|
||||
> import Data.Maybe
|
||||
> import Text.Parsec.String (GenParser)
|
||||
|
||||
> import Language.SQL.SimpleSQL.Syntax
|
||||
> import Language.SQL.SimpleSQL.Combinators
|
||||
> import Language.SQL.SimpleSQL.Errors
|
||||
> --import Language.SQL.SimpleSQL.Dialect
|
||||
> import Language.SQL.SimpleSQL.Dialect
|
||||
> import qualified Language.SQL.SimpleSQL.Lex as L
|
||||
> import Data.Maybe
|
||||
> import Text.Parsec.String (GenParser)
|
||||
|
||||
|
||||
= Public API
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
|
||||
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.
|
||||
Try to do this when this code is ported to a modern pretty printing lib.
|
||||
|
||||
> import Language.SQL.SimpleSQL.Syntax
|
||||
> --import Language.SQL.SimpleSQL.Dialect
|
||||
> import Text.PrettyPrint (render, vcat, text, (<>), (<+>), empty, parens,
|
||||
> nest, Doc, punctuate, comma, sep, quotes,
|
||||
|
@ -22,6 +22,11 @@ which have been changed to try to improve the layout of the output.
|
|||
> import Data.Maybe (maybeToList, catMaybes)
|
||||
> import Data.List (intercalate)
|
||||
|
||||
|
||||
> import Language.SQL.SimpleSQL.Syntax
|
||||
> import Language.SQL.SimpleSQL.Dialect
|
||||
|
||||
|
||||
> -- | Convert a query expr ast to concrete syntax.
|
||||
> prettyQueryExpr :: Dialect -> QueryExpr -> String
|
||||
> prettyQueryExpr d = render . queryExpr d
|
||||
|
|
|
@ -57,14 +57,11 @@
|
|||
> ,PrivilegeAction(..)
|
||||
> ,AdminOptionFor(..)
|
||||
> ,GrantOptionFor(..)
|
||||
> -- * Dialects
|
||||
> ,module Language.SQL.SimpleSQL.Dialect
|
||||
> -- * Comment
|
||||
> ,Comment(..)
|
||||
> ) where
|
||||
|
||||
> import Data.Data
|
||||
> import Language.SQL.SimpleSQL.Dialect
|
||||
|
||||
> -- | Represents a value expression. This is used for the expressions
|
||||
> -- in select lists. It is also used for expressions in where, group
|
||||
|
|
|
@ -18,13 +18,9 @@ indent: parse then pretty print sql
|
|||
|
||||
> import Language.SQL.SimpleSQL.Pretty
|
||||
> import Language.SQL.SimpleSQL.Parse
|
||||
> import Language.SQL.SimpleSQL.Syntax
|
||||
> import Language.SQL.SimpleSQL.Lex
|
||||
|
||||
|
||||
> dialect :: Dialect
|
||||
> dialect = ansi2011
|
||||
|
||||
> main :: IO ()
|
||||
> main = do
|
||||
> args <- getArgs
|
||||
|
@ -71,7 +67,7 @@ indent: parse then pretty print sql
|
|||
> (f,src) <- getInput args
|
||||
> either (error . peFormattedError)
|
||||
> (putStrLn . ppShow)
|
||||
> $ parseStatements dialect f Nothing src
|
||||
> $ parseStatements ansi2011 f Nothing src
|
||||
> )
|
||||
|
||||
> lexCommand :: (String,[String] -> IO ())
|
||||
|
@ -81,7 +77,7 @@ indent: parse then pretty print sql
|
|||
> (f,src) <- getInput args
|
||||
> either (error . peFormattedError)
|
||||
> (putStrLn . intercalate ",\n" . map show)
|
||||
> $ lexSQL dialect f Nothing src
|
||||
> $ lexSQL ansi2011 f Nothing src
|
||||
> )
|
||||
|
||||
|
||||
|
@ -91,7 +87,7 @@ indent: parse then pretty print sql
|
|||
> ,\args -> do
|
||||
> (f,src) <- getInput args
|
||||
> either (error . peFormattedError)
|
||||
> (putStrLn . prettyStatements dialect)
|
||||
> $ parseStatements dialect f Nothing src
|
||||
> (putStrLn . prettyStatements ansi2011)
|
||||
> $ parseStatements ansi2011 f Nothing src
|
||||
|
||||
> )
|
||||
|
|
Loading…
Reference in a new issue