32a674a4fe
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
22 lines
312 B
Go
22 lines
312 B
Go
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
|
|
}
|
|
if strings.ContainsRune("_:/+-@%^.!=", ch) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|