Browse Source

promql: fix lexing of \r as whitespaces

pull/767/head
Fabian Reinartz 10 years ago
parent
commit
c60e3387ef
  1. 2
      promql/lex.go
  2. 3
      promql/lex_test.go

2
promql/lex.go

@ -724,7 +724,7 @@ Loop:
}
func isSpace(r rune) bool {
return r == ' ' || r == '\t' || r == '\n'
return r == ' ' || r == '\t' || r == '\n' || r == '\r'
}
// isEndOfLine reports whether r is an end-of-line character.

3
promql/lex_test.go

@ -42,6 +42,9 @@ var tests = []struct {
{itemDuration, 1, `5m`},
{itemRightBracket, 3, `]`},
},
}, {
input: "\r\n\r",
expected: []item{},
},
// Test numbers.
{

Loading…
Cancel
Save