2016-01-08 20:14:31 +03:00
|
|
|
package match
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Super struct{}
|
|
|
|
|
2016-02-24 12:36:15 +03:00
|
|
|
func NewSuper() Super {
|
|
|
|
return Super{}
|
|
|
|
}
|
|
|
|
|
2018-02-16 17:36:02 +03:00
|
|
|
func (s Super) Match(_ string) bool {
|
2016-01-08 20:14:31 +03:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2018-02-16 17:36:02 +03:00
|
|
|
func (s Super) MinLen() int {
|
|
|
|
return 0
|
2016-01-09 02:34:41 +03:00
|
|
|
}
|
|
|
|
|
2018-02-16 17:36:02 +03:00
|
|
|
func (s Super) Index(v string) (int, []int) {
|
|
|
|
seg := acquireSegments(len(v) + 1)
|
|
|
|
for i := range v {
|
|
|
|
seg = append(seg, i)
|
2016-01-09 02:34:41 +03:00
|
|
|
}
|
2018-02-16 17:36:02 +03:00
|
|
|
seg = append(seg, len(v))
|
|
|
|
return 0, seg
|
2016-01-08 20:14:31 +03:00
|
|
|
}
|
|
|
|
|
2018-02-16 17:36:02 +03:00
|
|
|
func (s Super) String() string {
|
2016-01-13 01:26:48 +03:00
|
|
|
return fmt.Sprintf("<super>")
|
2016-01-08 20:14:31 +03:00
|
|
|
}
|