Index: tools/testing/dart/status_expression.dart |
diff --git a/tools/testing/dart/status_expression.dart b/tools/testing/dart/status_expression.dart |
index 2ac072a0534198dd5b3e83dce711ed697b0881a2..934ce59d200fead3061435973737cf46413bab4f 100644 |
--- a/tools/testing/dart/status_expression.dart |
+++ b/tools/testing/dart/status_expression.dart |
@@ -229,13 +229,16 @@ class ExpressionParser { |
if (scanner.current == Token.LEFT_PAREN) { |
scanner.advance(); |
SetExpression value = parseSetExpression(); |
- Expect.equals(scanner.current, Token.RIGHT_PAREN, |
- "Missing right parenthesis in expression"); |
+ if (scanner.current != Token.RIGHT_PAREN) { |
+ throw new RuntimeError("Missing right parenthesis in expression"); |
+ } |
scanner.advance(); |
return value; |
} |
- Expect.isTrue(new RegExp(r"^\w+$").hasMatch(scanner.current), |
- "Expected identifier in expression, got ${scanner.current}"); |
+ if (!new RegExp(r"^\w+$").hasMatch(scanner.current)) { |
+ throw new RuntimeError( |
+ "Expected identifier in expression, got ${scanner.current}"); |
+ } |
SetExpression value = new SetConstant(scanner.current); |
scanner.advance(); |
return value; |
@@ -267,25 +270,32 @@ class ExpressionParser { |
if (scanner.current == Token.LEFT_PAREN) { |
scanner.advance(); |
BooleanExpression value = parseBooleanExpression(); |
- Expect.equals(scanner.current, Token.RIGHT_PAREN, |
- "Missing right parenthesis in expression"); |
+ if (scanner.current != Token.RIGHT_PAREN) { |
+ throw new RuntimeError("Missing right parenthesis in expression"); |
+ } |
scanner.advance(); |
return value; |
} |
// The only atomic booleans are of the form $variable == value or the |
// form $variable. |
- Expect.equals(scanner.current, Token.DOLLAR_SYMBOL, |
- "Expected \$ in expression, got ${scanner.current}"); |
+ if (scanner.current != Token.DOLLAR_SYMBOL) { |
+ throw new RuntimeError( |
+ "Expected \$ in expression, got ${scanner.current}"); |
+ } |
scanner.advance(); |
- Expect.isTrue(new RegExp(r"^\w+$").hasMatch(scanner.current), |
- "Expected identifier in expression, got ${scanner.current}"); |
+ if (!new RegExp(r"^\w+$").hasMatch(scanner.current)) { |
+ throw new RuntimeError( |
+ "Expected identifier in expression, got ${scanner.current}"); |
+ } |
TermVariable left = new TermVariable(scanner.current); |
scanner.advance(); |
if (scanner.current == Token.EQUALS) { |
scanner.advance(); |
- Expect.isTrue(new RegExp(r"^\w+$").hasMatch(scanner.current), |
- "Expected identifier in expression, got ${scanner.current}"); |
+ if (!new RegExp(r"^\w+$").hasMatch(scanner.current)) { |
+ throw new RuntimeError( |
+ "Expected identifier in expression, got ${scanner.current}"); |
+ } |
TermConstant right = new TermConstant(scanner.current); |
scanner.advance(); |
return new Comparison(left, right); |