Adding upstream version 1.34.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e393c3af3f
commit
4978089aab
4963 changed files with 677545 additions and 0 deletions
46
plugins/parsers/wavefront/token.go
Normal file
46
plugins/parsers/wavefront/token.go
Normal file
|
@ -0,0 +1,46 @@
|
|||
package wavefront
|
||||
|
||||
type Token int
|
||||
|
||||
const (
|
||||
// Special tokens
|
||||
Illegal Token = iota
|
||||
EOF
|
||||
Ws
|
||||
|
||||
// Literals
|
||||
literalBeg
|
||||
Letter // metric name, source/point tags
|
||||
Number
|
||||
MinusSign
|
||||
Underscore
|
||||
Dot
|
||||
Slash
|
||||
Backslash
|
||||
Comma
|
||||
Delta
|
||||
literalEnd
|
||||
|
||||
// Misc characters
|
||||
Quotes
|
||||
Equals
|
||||
Newline
|
||||
)
|
||||
|
||||
func isWhitespace(ch rune) bool {
|
||||
return ch == ' ' || ch == '\t' || ch == '\n'
|
||||
}
|
||||
|
||||
func isLetter(ch rune) bool {
|
||||
return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
|
||||
}
|
||||
|
||||
func isNumber(ch rune) bool {
|
||||
return ch >= '0' && ch <= '9'
|
||||
}
|
||||
|
||||
func isDelta(ch rune) bool {
|
||||
return ch == '\u2206' || ch == '\u0394'
|
||||
}
|
||||
|
||||
var eof = rune(0)
|
Loading…
Add table
Add a link
Reference in a new issue