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-02 22:03:37 +03:00
|
|
|
func (self Super) Index(s string, segments []int) (int, []int) {
|
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
|
|
|
}
|