dialect variable in SimpleSqlParserTool.lhs
This commit is contained in:
parent
9e24a308e7
commit
58024e417e
|
@ -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
|
||||||
|
|
||||||
> )
|
> )
|
||||||
|
|
Loading…
Reference in a new issue