several changes:
1. moved scan/symbol.go to new package sym and adapted all files that reference Symbol type and its values. 2. new type interval defined by begin, end and step values. 3. replaced operator-range.go with operator-interval.go. 4. replaced range operator begin:end with begin..end..step. 5. new implementation of sub-collection extraction based on new interval literal.
This commit is contained in:
+17
-4
@@ -8,13 +8,14 @@ import (
|
||||
"strings"
|
||||
|
||||
"git.portale-stac.it/go-pkg/expr/kern"
|
||||
"git.portale-stac.it/go-pkg/expr/sym"
|
||||
)
|
||||
|
||||
type TermPriority uint32
|
||||
|
||||
const (
|
||||
PriNone TermPriority = iota
|
||||
PriRange
|
||||
PriInterval
|
||||
PriBut
|
||||
PriAssign
|
||||
PriIterOp // map, filter, digest, etc
|
||||
@@ -160,7 +161,7 @@ func (t *Term) SetParent(parent *Term) {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Term) Symbol() Symbol {
|
||||
func (t *Term) Symbol() sym.Symbol {
|
||||
return t.Tk.Sym
|
||||
}
|
||||
|
||||
@@ -200,12 +201,24 @@ func (t *Term) GetRightChild() (c kern.Term) {
|
||||
return
|
||||
}
|
||||
|
||||
func (t *Term) IsSymbol(symbol sym.Symbol) bool {
|
||||
return t.Symbol() == symbol
|
||||
}
|
||||
|
||||
func (t *Term) IsOneOf(symbols ...sym.Symbol) bool {
|
||||
return t.Tk.IsOneOf(symbols)
|
||||
}
|
||||
|
||||
func (t *Term) IsAssign() bool {
|
||||
return t.Symbol() == SymEqual
|
||||
return t.Symbol() == sym.SymEqual
|
||||
}
|
||||
|
||||
func (t *Term) IsVar() bool {
|
||||
return t.Symbol() == SymVariable
|
||||
return t.Symbol() == sym.SymVariable
|
||||
}
|
||||
|
||||
func (t *Term) SetSymbol(symbol sym.Symbol) {
|
||||
t.Tk.SetSymbol(symbol)
|
||||
}
|
||||
|
||||
// func (t *Term) IsFunc() bool {
|
||||
|
||||
Reference in New Issue
Block a user