本站源代码
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.

28 lines
371B

  1. package match
  2. import (
  3. "fmt"
  4. )
  5. type Nothing struct{}
  6. func NewNothing() Nothing {
  7. return Nothing{}
  8. }
  9. func (self Nothing) Match(s string) bool {
  10. return len(s) == 0
  11. }
  12. func (self Nothing) Index(s string) (int, []int) {
  13. return 0, segments0
  14. }
  15. func (self Nothing) Len() int {
  16. return lenZero
  17. }
  18. func (self Nothing) String() string {
  19. return fmt.Sprintf("<nothing>")
  20. }
上海开阖软件有限公司 沪ICP备12045867号-1