mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-02 14:46:31 +00:00
c28f7cb29f
Initial part of #435
30 lines
529 B
Go
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')
|
|
}
|