Merge "Revert changes to the alarm expression parser"
This commit is contained in:
commit
6478dbed8a
@ -21,11 +21,11 @@ start
|
||||
: expression EOF
|
||||
;
|
||||
|
||||
expression
|
||||
: function relational_operator literal ('times' repeat)? # relationalExprFuncFwd
|
||||
| literal relational_operator function ('times' repeat)? # relationalExprFuncBwd
|
||||
| compoundIdentifier relational_operator literal # relationalExprFwd
|
||||
expression
|
||||
: compoundIdentifier relational_operator literal # relationalExprFwd
|
||||
| function relational_operator literal ('times' repeat)? # relationalExprFuncFwd
|
||||
| literal relational_operator compoundIdentifier # relationalExprBwd
|
||||
| literal relational_operator function ('times' repeat)? # relationalExprFuncBwd
|
||||
| expression and expression # andExpr
|
||||
| expression or expression # orExpr
|
||||
| '(' expression ')' # parenExpr
|
||||
@ -132,7 +132,7 @@ repeat
|
||||
txt
|
||||
: TXT
|
||||
| keyword
|
||||
| INTEGER
|
||||
| INTEGER
|
||||
| STRING
|
||||
;
|
||||
LT
|
||||
@ -208,11 +208,11 @@ INTEGER
|
||||
;
|
||||
|
||||
DECIMAL
|
||||
: '-'?DIGIT+('.'DIGIT+)?
|
||||
: '-'?[0-9]+('.'[0-9]+)?
|
||||
;
|
||||
|
||||
TXT
|
||||
: ~('}' | '{' | '=' | ',' | ')' | '(' | ' ')*
|
||||
: [//a-zA-Z_$/\\0-9]~('\''|';' | '}' | '{' | '=' | ','| '&' | ')' | '(' |' '| '"' )+
|
||||
;
|
||||
|
||||
STRING
|
||||
|
@ -235,6 +235,7 @@ public class AlarmExpressionTest {
|
||||
assertNotEquals(expr1, expr3);
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = IllegalArgumentException.class)
|
||||
public void shouldParseDimensionsWithUnicode() {
|
||||
AlarmExpression expr1 = new AlarmExpression(
|
||||
"公{此=该,metric_name=mem} > 4"
|
||||
|
Loading…
x
Reference in New Issue
Block a user