pkg/dockerscript/extra.go
Solomon Hykes c757cfdcb1 dockerscript: patch text/scanner to use a shell-like syntax instead of the default go-like syntax
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-04-22 15:50:15 -07:00

22 lines
309 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
}