1
Fork 0

parse functions whose name is a keyword

This commit is contained in:
Jake Wheat 2016-02-18 20:37:12 +02:00
parent 90e66f4888
commit c0b4358d89
2 changed files with 110 additions and 33 deletions
tools/Language/SQL/SimpleSQL

View file

@ -20,6 +20,7 @@ Tests for parsing value expressions
> ,subqueries
> ,aggregates
> ,windowFunctions
> ,functionsWithReservedNames
> ]
> literals :: TestItem
@ -404,3 +405,11 @@ target_string
> [("(a)", Parens (Iden [Name Nothing "a"]))
> ,("(a + b)", Parens (BinOp (Iden [Name Nothing "a"]) [Name Nothing "+"] (Iden [Name Nothing "b"])))
> ]
> functionsWithReservedNames :: TestItem
> functionsWithReservedNames = Group "functionsWithReservedNames" $ map t
> ["abs"
> ,"char_length"
> ]
> where
> t fn = TestValueExpr ansi2011 (fn ++ "(a)") $ App [Name Nothing fn] [Iden [Name Nothing "a"]]