mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
bf51f36d8f
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
21 lines
311 B
Go
21 lines
311 B
Go
package scanner
|
|
|
|
import (
|
|
"strings"
|
|
"unicode"
|
|
)
|
|
|
|
// 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
|
|
}
|