Index: pkg/analyzer/lib/src/generated/parser.dart |
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart |
index ab3b05e0f98e02ddc4bb3dbf527a9c6c91003a10..6e45c8e1441a3cd3455a5f15f362506ea7e214c5 100644 |
--- a/pkg/analyzer/lib/src/generated/parser.dart |
+++ b/pkg/analyzer/lib/src/generated/parser.dart |
@@ -4357,25 +4357,12 @@ class Parser { |
* This method assumes that the current token matches `Keyword.ASSERT`. |
* |
* assertStatement ::= |
- * 'assert' '(' conditionalExpression ')' ';' |
+ * 'assert' '(' expression [',' expression] ')' ';' |
*/ |
AssertStatement _parseAssertStatement() { |
Token keyword = getAndAdvance(); |
Token leftParen = _expect(TokenType.OPEN_PAREN); |
Expression expression = parseExpression2(); |
- if (expression is AssignmentExpression) { |
- _reportErrorForNode( |
- ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT, expression); |
- } else if (expression is CascadeExpression) { |
- _reportErrorForNode( |
- ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE, expression); |
- } else if (expression is ThrowExpression) { |
- _reportErrorForNode( |
- ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW, expression); |
- } else if (expression is RethrowExpression) { |
- _reportErrorForNode( |
- ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW, expression); |
- } |
Token comma; |
Expression message; |
if (_matches(TokenType.COMMA)) { |
@@ -9896,22 +9883,6 @@ class ParserErrorCode extends ErrorCode { |
const ParserErrorCode('ANNOTATION_ON_ENUM_CONSTANT', |
"Enum constants cannot have annotations"); |
- static const ParserErrorCode ASSERT_DOES_NOT_TAKE_ASSIGNMENT = |
- const ParserErrorCode('ASSERT_DOES_NOT_TAKE_ASSIGNMENT', |
- "Assert cannot be called on an assignment"); |
- |
- static const ParserErrorCode ASSERT_DOES_NOT_TAKE_CASCADE = |
- const ParserErrorCode( |
- 'ASSERT_DOES_NOT_TAKE_CASCADE', "Assert cannot be called on cascade"); |
- |
- static const ParserErrorCode ASSERT_DOES_NOT_TAKE_THROW = |
- const ParserErrorCode( |
- 'ASSERT_DOES_NOT_TAKE_THROW', "Assert cannot be called on throws"); |
- |
- static const ParserErrorCode ASSERT_DOES_NOT_TAKE_RETHROW = |
- const ParserErrorCode('ASSERT_DOES_NOT_TAKE_RETHROW', |
- "Assert cannot be called on rethrows"); |
- |
/** |
* 16.32 Identifier Reference: It is a compile-time error if any of the |
* identifiers async, await, or yield is used as an identifier in a function |