1
Fork 0

spelling fixes

This commit is contained in:
Jake Wheat 2013-12-17 22:15:19 +02:00
parent 5cef82cbb3
commit bcd06d1ef9
3 changed files with 20 additions and 20 deletions

View file

@ -64,7 +64,7 @@ it should work on some of the other syntax (such as in).
> fixFixities fs se = > fixFixities fs se =
> runIdentity $ toSql <$> HSE.applyFixities (toHSEFixity fs) (toHaskell se) > runIdentity $ toSql <$> HSE.applyFixities (toHSEFixity fs) (toHaskell se)
Now have to convert all our scalar exprs to haskell and back again. Now have to convert all our scalar exprs to Haskell and back again.
Have to come up with a recipe for each ctor. Only continue if you have Have to come up with a recipe for each ctor. Only continue if you have
a strong stomach. Probably would have been less effort to just write a strong stomach. Probably would have been less effort to just write
the fixity code. the fixity code.

View file

@ -130,7 +130,7 @@ identifiers.
used in select *, select x.*, and agg(*) variations, and some other used in select *, select x.*, and agg(*) variations, and some other
places as well. Because it is quite general, the parser doesn't places as well. Because it is quite general, the parser doesn't
attempt to check that the star is in a valid context, it parses it ok attempt to check that the star is in a valid context, it parses it OK
in any scalar expression context. in any scalar expression context.
> star :: P ScalarExpr > star :: P ScalarExpr

View file

@ -1,5 +1,5 @@
> -- | The AST for SQL queries > -- | The AST for SQL queries.
> module Language.SQL.SimpleSQL.Syntax > module Language.SQL.SimpleSQL.Syntax
> (-- * Scalar expressions > (-- * Scalar expressions
> ScalarExpr(..) > ScalarExpr(..)
@ -27,7 +27,7 @@
> ,JoinCondition(..) > ,JoinCondition(..)
> ) where > ) where
> -- | Represents a scalar expression > -- | Represents a scalar expression.
> data ScalarExpr > data ScalarExpr
> = -- | a numeric literal optional decimal point, e+- > = -- | a numeric literal optional decimal point, e+-
> -- integral exponent, e.g > -- integral exponent, e.g
@ -112,7 +112,7 @@
> | In Bool ScalarExpr InThing > | In Bool ScalarExpr InThing
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)
> -- | Represents an identifier name, which can be quoted or unquoted > -- | Represents an identifier name, which can be quoted or unquoted.
> data Name = Name String > data Name = Name String
> | QName String > | QName String
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)
@ -125,12 +125,12 @@
> -- | Used for 'expr in (scalar expression list)', and 'expr in > -- | Used for 'expr in (scalar expression list)', and 'expr in
> -- (subquery)' syntax > -- (subquery)' syntax.
> data InThing = InList [ScalarExpr] > data InThing = InList [ScalarExpr]
> | InQueryExpr QueryExpr > | InQueryExpr QueryExpr
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)
> -- | A subquery in a scalar expression > -- | A subquery in a scalar expression.
> data SubQueryExprType > data SubQueryExprType
> = -- | exists (query expr) > = -- | exists (query expr)
> SqExists > SqExists
@ -144,24 +144,24 @@
> | SqAny > | SqAny
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)
> -- | Represents one field in an order by list > -- | Represents one field in an order by list.
> data OrderField = OrderField ScalarExpr Direction NullsOrder > data OrderField = OrderField ScalarExpr Direction NullsOrder
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)
> -- | Represents 'nulls first' or 'nulls last' in an order by clause > -- | Represents 'nulls first' or 'nulls last' in an order by clause.
> data NullsOrder = NullsOrderDefault > data NullsOrder = NullsOrderDefault
> | NullsFirst > | NullsFirst
> | NullsLast > | NullsLast
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)
> -- | Represents theq frame clause of a window > -- | Represents the frame clause of a window
> -- this can be [range | rows] frame_start > -- this can be [range | rows] frame_start
> -- or [range | rows] between frame_start and frame_end > -- or [range | rows] between frame_start and frame_end
> data Frame = FrameFrom FrameRows FramePos > data Frame = FrameFrom FrameRows FramePos
> | FrameBetween FrameRows FramePos FramePos > | FrameBetween FrameRows FramePos FramePos
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)
> -- | Represents whether a window frame clause is over rows or ranges > -- | Represents whether a window frame clause is over rows or ranges.
> data FrameRows = FrameRows | FrameRange > data FrameRows = FrameRows | FrameRange
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)
@ -217,8 +217,8 @@ TODO: add queryexpr parens to deal with e.g.
(select 1 union select 2) union select 3 (select 1 union select 2) union select 3
I'm not sure if this is valid syntax or not. I'm not sure if this is valid syntax or not.
> -- | helper/'default' value for query exprs to make creating query > -- | Helper/'default' value for query exprs to make creating query
> -- expr values a little easier > -- expr values a little easier.
> makeSelect :: QueryExpr > makeSelect :: QueryExpr
> makeSelect = Select {qeDuplicates = All > makeSelect = Select {qeDuplicates = All
> ,qeSelectList = [] > ,qeSelectList = []
@ -231,19 +231,19 @@ I'm not sure if this is valid syntax or not.
> ,qeFetch = Nothing} > ,qeFetch = Nothing}
> -- | represents the Distinct or All keywords, which can be used > -- | Represents the Distinct or All keywords, which can be used
> -- before a select list, in an aggregate/window function > -- before a select list, in an aggregate/window function
> -- application, or in a query expression set operator > -- application, or in a query expression set operator.
> data Duplicates = Distinct | All deriving (Eq,Show,Read) > data Duplicates = Distinct | All deriving (Eq,Show,Read)
> -- | The direction for a column in order by. > -- | The direction for a column in order by.
> data Direction = Asc | Desc deriving (Eq,Show,Read) > data Direction = Asc | Desc deriving (Eq,Show,Read)
> -- | Query expression set operators > -- | Query expression set operators.
> data CombineOp = Union | Except | Intersect deriving (Eq,Show,Read) > data CombineOp = Union | Except | Intersect deriving (Eq,Show,Read)
> -- | Corresponding, an option for the set operators > -- | Corresponding, an option for the set operators.
> data Corresponding = Corresponding | Respectively deriving (Eq,Show,Read) > data Corresponding = Corresponding | Respectively deriving (Eq,Show,Read)
> -- | Represents an item in a group by clause > -- | Represents an item in a group by clause.
> data GroupingExpr > data GroupingExpr
> = GroupingParens [GroupingExpr] > = GroupingParens [GroupingExpr]
> | Cube [GroupingExpr] > | Cube [GroupingExpr]
@ -271,13 +271,13 @@ I'm not sure if this is valid syntax or not.
> -- | Represents an alias for a table valued expression, used in with > -- | Represents an alias for a table valued expression, used in with
> -- queries and in from alias, e.g. select a from t u, select a from t u(b), > -- queries and in from alias, e.g. select a from t u, select a from t u(b),
> -- with a(c) as select 1, select * from a; > -- with a(c) as select 1, select * from a.
> data Alias = Alias Name (Maybe [Name]) > data Alias = Alias Name (Maybe [Name])
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)
TODO: add function table ref TODO: add function table ref
> -- | The type of a join > -- | The type of a join.
> data JoinType = JInner | JLeft | JRight | JFull | JCross > data JoinType = JInner | JLeft | JRight | JFull | JCross
> deriving (Eq,Show,Read) > deriving (Eq,Show,Read)