Merge pull request #12 from gbordyugov/tool-update
tools/SimpleSqlParserTool.lhs fix
This commit is contained in:
commit
e3b6f1570e
|
@ -17,11 +17,13 @@ indent: parse then pretty print sql
|
||||||
> import Control.Applicative
|
> import Control.Applicative
|
||||||
|
|
||||||
> import Language.SQL.SimpleSQL.Pretty
|
> import Language.SQL.SimpleSQL.Pretty
|
||||||
> import Language.SQL.SimpleSQL.Parser
|
> import Language.SQL.SimpleSQL.Parse
|
||||||
> import Language.SQL.SimpleSQL.Syntax
|
> import Language.SQL.SimpleSQL.Syntax
|
||||||
> import Language.SQL.SimpleSQL.Lexer
|
> import Language.SQL.SimpleSQL.Lex
|
||||||
|
|
||||||
|
|
||||||
|
> dialect = ansi2011
|
||||||
|
|
||||||
> main :: IO ()
|
> main :: IO ()
|
||||||
> main = do
|
> main = do
|
||||||
> args <- getArgs
|
> args <- getArgs
|
||||||
|
@ -68,7 +70,7 @@ indent: parse then pretty print sql
|
||||||
> (f,src) <- getInput args
|
> (f,src) <- getInput args
|
||||||
> either (error . peFormattedError)
|
> either (error . peFormattedError)
|
||||||
> (putStrLn . ppShow)
|
> (putStrLn . ppShow)
|
||||||
> $ parseStatements SQL2011 f Nothing src
|
> $ parseStatements dialect f Nothing src
|
||||||
> )
|
> )
|
||||||
|
|
||||||
> lexCommand :: (String,[String] -> IO ())
|
> lexCommand :: (String,[String] -> IO ())
|
||||||
|
@ -78,7 +80,7 @@ indent: parse then pretty print sql
|
||||||
> (f,src) <- getInput args
|
> (f,src) <- getInput args
|
||||||
> either (error . peFormattedError)
|
> either (error . peFormattedError)
|
||||||
> (putStrLn . intercalate ",\n" . map show)
|
> (putStrLn . intercalate ",\n" . map show)
|
||||||
> $ lexSQL SQL2011 f Nothing src
|
> $ lexSQL dialect f Nothing src
|
||||||
> )
|
> )
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,7 +90,7 @@ indent: parse then pretty print sql
|
||||||
> ,\args -> do
|
> ,\args -> do
|
||||||
> (f,src) <- getInput args
|
> (f,src) <- getInput args
|
||||||
> either (error . peFormattedError)
|
> either (error . peFormattedError)
|
||||||
> (putStrLn . prettyStatements SQL2011)
|
> (putStrLn . prettyStatements dialect)
|
||||||
> $ parseStatements SQL2011 f Nothing src
|
> $ parseStatements dialect f Nothing src
|
||||||
|
|
||||||
> )
|
> )
|
||||||
|
|
Loading…
Reference in a new issue