glob/match/super.go

31 lines
453 B
Go
Raw Normal View History

2016-01-08 20:14:31 +03:00
package match
import (
"fmt"
)
type Super struct{}
func (self Super) Match(s string) bool {
return true
}
2016-01-09 02:34:41 +03:00
func (self Super) Len() int {
2016-01-14 18:29:13 +03:00
return lenNo
2016-01-09 02:34:41 +03:00
}
2016-02-05 17:29:41 +03:00
func (self Super) Index(s string) (int, []int) {
2016-02-23 14:46:20 +03:00
//todo acquire here
2016-02-05 17:29:41 +03:00
segments := make([]int, 0, len(s)+1)
2016-01-09 02:34:41 +03:00
for i := range s {
segments = append(segments, i)
}
segments = append(segments, len(s))
return 0, segments
2016-01-08 20:14:31 +03:00
}
func (self Super) String() string {
2016-01-13 01:26:48 +03:00
return fmt.Sprintf("<super>")
2016-01-08 20:14:31 +03:00
}