mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-19 17:00:37 +00:00
Code cleanup; Split test files
This commit is contained in:
@@ -1,37 +1,5 @@
|
||||
package parsers
|
||||
|
||||
type LogicalExpressionType int
|
||||
|
||||
const (
|
||||
LogicalExpressionTypeOr LogicalExpressionType = iota
|
||||
LogicalExpressionTypeAnd
|
||||
)
|
||||
|
||||
type ConstantType int
|
||||
|
||||
const (
|
||||
ConstantTypeString ConstantType = iota
|
||||
ConstantTypeInteger
|
||||
ConstantTypeFloat
|
||||
ConstantTypeBoolean
|
||||
ConstantTypeParameterConstant
|
||||
)
|
||||
|
||||
type SelectItemType int
|
||||
|
||||
const (
|
||||
SelectItemTypeField SelectItemType = iota
|
||||
SelectItemTypeObject
|
||||
SelectItemTypeArray
|
||||
)
|
||||
|
||||
type OrderDirection int
|
||||
|
||||
const (
|
||||
OrderDirectionAsc OrderDirection = iota
|
||||
OrderDirectionDesc
|
||||
)
|
||||
|
||||
type SelectStmt struct {
|
||||
SelectItems []SelectItem
|
||||
Table Table
|
||||
@@ -45,14 +13,31 @@ type Table struct {
|
||||
Value string
|
||||
}
|
||||
|
||||
type SelectItemType int
|
||||
|
||||
const (
|
||||
SelectItemTypeField SelectItemType = iota
|
||||
SelectItemTypeObject
|
||||
SelectItemTypeArray
|
||||
SelectItemTypeConstant
|
||||
)
|
||||
|
||||
type SelectItem struct {
|
||||
Alias string
|
||||
Path []string
|
||||
SelectItems []SelectItem
|
||||
Type SelectItemType
|
||||
Value interface{}
|
||||
IsTopLevel bool
|
||||
}
|
||||
|
||||
type LogicalExpressionType int
|
||||
|
||||
const (
|
||||
LogicalExpressionTypeOr LogicalExpressionType = iota
|
||||
LogicalExpressionTypeAnd
|
||||
)
|
||||
|
||||
type LogicalExpression struct {
|
||||
Expressions []interface{}
|
||||
Operation LogicalExpressionType
|
||||
@@ -64,11 +49,28 @@ type ComparisonExpression struct {
|
||||
Operation string
|
||||
}
|
||||
|
||||
type ConstantType int
|
||||
|
||||
const (
|
||||
ConstantTypeString ConstantType = iota
|
||||
ConstantTypeInteger
|
||||
ConstantTypeFloat
|
||||
ConstantTypeBoolean
|
||||
ConstantTypeParameterConstant
|
||||
)
|
||||
|
||||
type Constant struct {
|
||||
Type ConstantType
|
||||
Value interface{}
|
||||
}
|
||||
|
||||
type OrderDirection int
|
||||
|
||||
const (
|
||||
OrderDirectionAsc OrderDirection = iota
|
||||
OrderDirectionDesc
|
||||
)
|
||||
|
||||
type OrderExpression struct {
|
||||
SelectItem SelectItem
|
||||
Direction OrderDirection
|
||||
|
||||
Reference in New Issue
Block a user