1
Fork 0

add support for rowctor without row, e.g. (1,2)

This commit is contained in:
Jake Wheat 2013-12-17 16:20:05 +02:00
parent 89a4dd0e3e
commit e03090a6a1
3 changed files with 12 additions and 2 deletions
Language/SQL/SimpleSQL

View file

@ -302,10 +302,14 @@ that SQL supports.
> <$ try (keyword_ "character" <* keyword_ "varying")
> ,TypeName <$> identifierString]
== scalar parens
== scalar parens and row ctor
> sparens :: P ScalarExpr
> sparens = Parens <$> parens scalarExpr'
> sparens =
> ctor <$> parens (commaSep1 scalarExpr')
> where
> ctor [a] = Parens a
> ctor as = SpecialOp (Name "rowctor") as
== operator parsing

View file

@ -80,6 +80,9 @@
> <+> text "for"
> <+> scalarExpr e)
> scalarExpr (SpecialOp (Name "rowctor") as) =
> parens $ commaSep $ map scalarExpr as
> scalarExpr (SpecialOp nm es) =
> name nm <+> parens (commaSep $ map scalarExpr es)