Also allow lower-cased aggregation ops.

This commit is contained in:
Julius Volz 2013-04-09 14:00:25 +02:00
parent f9c291120f
commit 1bc83e1b65
3 changed files with 27 additions and 1 deletions

View file

@ -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 {