diff --git a/tools/Language/SQL/SimpleSQL/SQL2011.lhs b/tools/Language/SQL/SimpleSQL/SQL2011.lhs index 2e8931d..d4d288e 100644 --- a/tools/Language/SQL/SimpleSQL/SQL2011.lhs +++ b/tools/Language/SQL/SimpleSQL/SQL2011.lhs @@ -15,7 +15,7 @@ which parts aren't currently supported. > sql2011Tests = Group "sql 2011 tests" > [literals > ,identifiers -> ,typeNames +> ,typeNameTests > ,valueExpressions > ,queryExpressions > ,scalarSubquery @@ -481,7 +481,21 @@ Specify a non-null value. > characterStringLiterals :: TestItem > characterStringLiterals = Group "character string literals" -> [-- TODO: character string literals +> $ map (uncurry TestValueExpr) +> [("'a regular string literal'" +> ,StringLit "a regular string literal") +> ,("'something' ' some more' 'and more'" +> ,StringLit "something some moreand more") +> ,("'something' \n ' some more' \t 'and more'" +> ,StringLit "something some moreand more") +> ,("'something' -- a comment\n ' some more' /*another comment*/ 'and more'" +> ,StringLit "something some moreand more") +> ,("'a quote: '', stuff'" +> ,StringLit "a quote: ', stuff") +> ,("''" +> ,StringLit "") +> ,("_francais 'français'" +> ,TypedLit (TypeName [Name "_francais"]) "français") > ] ::= @@ -490,10 +504,11 @@ Specify a non-null value. > nationalCharacterStringLiterals :: TestItem > nationalCharacterStringLiterals = Group "national character string literals" -> [-- TODO: national character string literals +> $ map (uncurry TestValueExpr) +> [("N'something'", CSStringLit "N" "something") +> ,("n'something'", CSStringLit "n" "something") > ] - ::= [ ] U [ ... ] @@ -506,9 +521,16 @@ Specify a non-null value. > unicodeCharacterStringLiterals :: TestItem > unicodeCharacterStringLiterals = Group "unicode character string literals" -> [-- TODO: unicode character string literals +> $ map (uncurry TestValueExpr) +> [("U&'something'", CSStringLit "U&" "something") +> ,("u&'something' escape =" +> ,Escape (CSStringLit "u&" "something") '=') +> ,("u&'something' uescape =" +> ,UEscape (CSStringLit "u&" "something") '=') > ] +TODO: unicode escape + ::= X [ ... ] [ { [ ... ] [ ... ] }... ] [ { [ ... ] [ { [ ... ] @@ -518,7 +540,10 @@ Specify a non-null value. > binaryStringLiterals :: TestItem > binaryStringLiterals = Group "binary string literals" -> [-- TODO: binary string literals +> $ map (uncurry TestValueExpr) +> [--("B'101010'", CSStringLit "B" "101010") +> ("X'7f7f7f'", CSStringLit "X" "7f7f7f") +> ,("X'7f7f7f' escape z", Escape (CSStringLit "X" "7f7f7f") 'z') > ] ::= [ ] @@ -545,7 +570,34 @@ Specify a non-null value. > numericLiterals :: TestItem > numericLiterals = Group "numeric literals" -> [-- TODO: numeric literals +> $ map (uncurry TestValueExpr) +> [("11", NumLit "11") +> ,("11.11", NumLit "11.11") + +> ,("11E23", NumLit "11E23") +> ,("11E+23", NumLit "11E+23") +> ,("11E-23", NumLit "11E-23") + +> ,("11.11E23", NumLit "11.11E23") +> ,("11.11E+23", NumLit "11.11E+23") +> ,("11.11E-23", NumLit "11.11E-23") + +> ,("+11E23", PrefixOp [Name "+"] $ NumLit "11E23") +> ,("+11E+23", PrefixOp [Name "+"] $ NumLit "11E+23") +> ,("+11E-23", PrefixOp [Name "+"] $ NumLit "11E-23") +> ,("+11.11E23", PrefixOp [Name "+"] $ NumLit "11.11E23") +> ,("+11.11E+23", PrefixOp [Name "+"] $ NumLit "11.11E+23") +> ,("+11.11E-23", PrefixOp [Name "+"] $ NumLit "11.11E-23") + +> ,("-11E23", PrefixOp [Name "-"] $ NumLit "11E23") +> ,("-11E+23", PrefixOp [Name "-"] $ NumLit "11E+23") +> ,("-11E-23", PrefixOp [Name "-"] $ NumLit "11E-23") +> ,("-11.11E23", PrefixOp [Name "-"] $ NumLit "11.11E23") +> ,("-11.11E+23", PrefixOp [Name "-"] $ NumLit "11.11E+23") +> ,("-11.11E-23", PrefixOp [Name "-"] $ NumLit "11.11E-23") + +> ,("11.11e23", NumLit "11.11e23") + > ] ::= |