extra.go 310 B

12345678910111213141516171819202122
  1. package scanner
  2. import (
  3. "unicode"
  4. "strings"
  5. )
  6. // extra functions used to hijack the upstream text/scanner
  7. func detectIdent(ch rune) bool {
  8. if unicode.IsLetter(ch) {
  9. return true
  10. }
  11. if unicode.IsDigit(ch) {
  12. return true
  13. }
  14. if strings.ContainsRune("_:/+-@%^.", ch) {
  15. return true
  16. }
  17. return false
  18. }