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-22 02:21:53 +00:00
|
|
|
if strings.ContainsRune("_:/+-@%^.", ch) {
|
2014-03-22 00:40:11 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|