1
Fork 0

dialect variable in SimpleSqlParserTool.lhs

This commit is contained in:
Grigory Bordyugov 2017-02-09 13:15:23 +01:00
parent 9e24a308e7
commit 58024e417e

View file

@ -22,6 +22,8 @@ indent: parse then pretty print sql
> import Language.SQL.SimpleSQL.Lex > 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 ansi2011 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 ansi2011 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 ansi2011) > (putStrLn . prettyStatements dialect)
> $ parseStatements ansi2011 f Nothing src > $ parseStatements dialect f Nothing src
> ) > )