2014-03-21 17:40:11 -07:00
|
|
|
package scanner
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
2014-04-22 16:09:42 -07:00
|
|
|
"unicode"
|
2014-03-21 17:40:11 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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-27 18:27:32 -07:00
|
|
|
if strings.ContainsRune("_:/+-@%^.!=", ch) {
|
2014-03-21 17:40:11 -07:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|