mirror of
https://github.com/prometheus/prometheus.git
synced 2025-07-03 11:03:25 +00:00
Also allow lower-cased aggregation ops.
This commit is contained in:
parent
f9c291120f
commit
1bc83e1b65
3 changed files with 27 additions and 1 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
import (
|
||||
"github.com/prometheus/prometheus/model"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var yyin io.Reader = os.Stdin
|
||||
|
@ -341,6 +342,20 @@ var yyrules []yyrule = []yyrule{{regexp.MustCompile("[^\\n]"), nil, []yystartcon
|
|||
return yyactionreturn{AGGR_OP, yyRT_USER_RETURN}
|
||||
}
|
||||
return yyactionreturn{0, yyRT_FALLTHROUGH}
|
||||
}}, {regexp.MustCompile("avg|sum|max|min"), nil, []yystartcondition{}, false, func() (yyar yyactionreturn) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
if r != "yyREJECT" {
|
||||
panic(r)
|
||||
}
|
||||
yyar.returnType = yyRT_REJECT
|
||||
}
|
||||
}()
|
||||
{
|
||||
yylval.str = strings.ToUpper(yytext)
|
||||
return yyactionreturn{AGGR_OP, yyRT_USER_RETURN}
|
||||
}
|
||||
return yyactionreturn{0, yyRT_FALLTHROUGH}
|
||||
}}, {regexp.MustCompile("\\<|>|AND|OR"), nil, []yystartcondition{}, false, func() (yyar yyactionreturn) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue