woodpecker/vendor/github.com/quasilyte/regex/syntax/utils.go
Lukas c28f7cb29f
Add golangci-lint (#502)
Initial part of #435
2021-11-14 21:01:54 +01:00

30 lines
529 B
Go

package syntax
func isSpace(ch byte) bool {
switch ch {
case '\r', '\n', '\t', '\f', '\v':
return true
default:
return false
}
}
func isAlphanumeric(ch byte) bool {
return (ch >= 'a' && ch <= 'z') ||
(ch >= 'A' && ch <= 'Z') ||
(ch >= '0' && ch <= '9')
}
func isDigit(ch byte) bool {
return ch >= '0' && ch <= '9'
}
func isOctalDigit(ch byte) bool {
return ch >= '0' && ch <= '7'
}
func isHexDigit(ch byte) bool {
return (ch >= '0' && ch <= '9') ||
(ch >= 'a' && ch <= 'f') ||
(ch >= 'A' && ch <= 'F')
}