1
Fork 0

tweak to error message for reserved keyword as identifier

add in some group by and order by tests
This commit is contained in:
Jake Wheat 2014-04-18 10:47:39 +03:00
parent 2e44b7b968
commit c814cc9437
3 changed files with 77 additions and 99 deletions
Language/SQL/SimpleSQL

View file

@ -8,7 +8,7 @@
> ,ParseError(..)) where
> import Control.Monad.Identity (Identity)
> import Control.Monad (guard, void)
> import Control.Monad (guard, void, when)
> import Control.Applicative ((<$), (<$>), (<*>) ,(<*), (*>))
> import Data.Maybe (fromMaybe,catMaybes)
> import Data.Char (toLower)
@ -1079,7 +1079,8 @@ instead, and create an alternative suffix parser
> identifierBlacklist :: [String] -> Parser String
> identifierBlacklist bl = try (do
> i <- identifier
> guard (map toLower i `notElem` bl)
> when (map toLower i `elem` bl) $
> fail $ "keyword not allowed here: " ++ i
> return i)
> <?> "identifier"