1
Fork 0

fixes to docs

This commit is contained in:
Jake Wheat 2019-07-07 13:46:39 +01:00
parent 5db749128a
commit 525a1a8652
6 changed files with 20 additions and 11 deletions

View file

@ -16,7 +16,7 @@ have a relatively high assurance of the low level of bugs. This is
much more difficult to get parity with when testing the syntax parser much more difficult to get parity with when testing the syntax parser
directly without the separately testing lexing stage. directly without the separately testing lexing stage.
> -- | This is the module contains a Lexer for SQL. > -- | Lexer for SQL.
> {-# LANGUAGE TupleSections #-} > {-# LANGUAGE TupleSections #-}
> module Language.SQL.SimpleSQL.Lex > module Language.SQL.SimpleSQL.Lex
> (Token(..) > (Token(..)
@ -52,7 +52,7 @@ directly without the separately testing lexing stage.
> data Token > data Token
> -- | A symbol (in ansi dialect) is one of the following > -- | A symbol (in ansi dialect) is one of the following
> -- > --
> -- * multi char symbols <> <= >= != || > -- * multi char symbols <> \<= \>= != ||
> -- * single char symbols: * + - < > ^ / % ~ & | ? ( ) [ ] , ; ( ) > -- * single char symbols: * + - < > ^ / % ~ & | ? ( ) [ ] , ; ( )
> -- > --
> = Symbol String > = Symbol String

2
TODO
View file

@ -6,8 +6,8 @@ fixed these
https://github.com/JakeWheat/simple-sql-parser/issues/18 https://github.com/JakeWheat/simple-sql-parser/issues/18
this one is fixed now, need postgres dialect atm this one is fixed now, need postgres dialect atm
https://github.com/JakeWheat/simple-sql-parser/issues/15 https://github.com/JakeWheat/simple-sql-parser/issues/15
update changelog
test with different ghcs test with different ghcs
update changelog
do release do release

View file

@ -5,9 +5,12 @@ import System.Environment
import Text.Show.Pretty import Text.Show.Pretty
import System.IO import System.IO
import Language.SQL.SimpleSQL.Parse (parseStatements,peFormattedError) import Language.SQL.SimpleSQL.Parse
(parseStatements
,ParseError
,peFormattedError)
import Language.SQL.SimpleSQL.Syntax (ansi2011) import Language.SQL.SimpleSQL.Syntax (ansi2011, Statement)
main :: IO () main :: IO ()
@ -37,7 +40,8 @@ main = do
doIt :: String -> IO () doIt :: String -> IO ()
doIt src = do doIt src = do
let parsed = parseStatements ansi2011 "" Nothing src let parsed :: Either ParseError [Statement]
parsed = parseStatements ansi2011 "" Nothing src
either (error . peFormattedError) either (error . peFormattedError)
(putStrLn . ppShow) (putStrLn . ppShow)
parsed parsed

View file

@ -298,9 +298,12 @@ import System.Environment
import Text.Show.Pretty import Text.Show.Pretty
import System.IO import System.IO
import Language.SQL.SimpleSQL.Parse (parseStatements,peFormattedError) import Language.SQL.SimpleSQL.Parse
(parseStatements
,ParseError
,peFormattedError)
import Language.SQL.SimpleSQL.Syntax (ansi2011) import Language.SQL.SimpleSQL.Syntax (ansi2011, Statement)
main :: IO () main :: IO ()
@ -330,10 +333,12 @@ main = do
doIt :: String -> IO () doIt :: String -> IO ()
doIt src = do doIt src = do
let parsed = parseStatements ansi2011 "" Nothing src let parsed :: Either ParseError [Statement]
parsed = parseStatements ansi2011 "" Nothing src
either (error . peFormattedError) either (error . peFormattedError)
(putStrLn . ppShow) (putStrLn . ppShow)
parsed parsed
---- ----

View file

@ -33,4 +33,4 @@ rm build/test_cases.asciidoc
cabal v2-haddock cabal v2-haddock
rm -Rf build/haddock rm -Rf build/haddock
mkdir build/haddock/ mkdir build/haddock/
cp -R dist/doc/html/simple-sql-parser/* build/haddock/ cp -R dist-newstyle/build/x86_64-linux/ghc-8.6.5/simple-sql-parser-0.5.0/doc/html/simple-sql-parser/* build/haddock/

View file

@ -22,7 +22,7 @@ additional pass over the ast can be made if you want to carefully
prohibit everything that the standard doesn't allow. prohibit everything that the standard doesn't allow.
Apart from this permissiveness, some work has been put into trying to Apart from this permissiveness, some work has been put into trying to
get the best parser error messages possible. get good parser error messages.
== Queries == Queries