本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
478B

  1. package match
  2. import (
  3. "fmt"
  4. )
  5. type Super struct{}
  6. func NewSuper() Super {
  7. return Super{}
  8. }
  9. func (self Super) Match(s string) bool {
  10. return true
  11. }
  12. func (self Super) Len() int {
  13. return lenNo
  14. }
  15. func (self Super) Index(s string) (int, []int) {
  16. segments := acquireSegments(len(s) + 1)
  17. for i := range s {
  18. segments = append(segments, i)
  19. }
  20. segments = append(segments, len(s))
  21. return 0, segments
  22. }
  23. func (self Super) String() string {
  24. return fmt.Sprintf("<super>")
  25. }
上海开阖软件有限公司 沪ICP备12045867号-1