2014-03-22 00:40:11 +00:00
|
|
|
package scanner
|
|
|
|
|
|
|
|
import (
|
|
|
|
"unicode"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
// extra functions used to hijack the upstream text/scanner
|
|
|
|
|
|
|
|
func detectIdent(ch rune) bool {
|
|
|
|
if unicode.IsLetter(ch) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
if unicode.IsDigit(ch) {
|
|
|
|
return true
|
|
|
|
}
|
2014-03-24 03:43:14 +00:00
|
|
|
if strings.ContainsRune("_:/+-@%^.!", ch) {
|
2014-03-22 00:40:11 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|