Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: pkg/analyzer/lib/src/generated/testing/ast_factory.dart

Issue 1309543011: Add support for assert statements with messages to the analyzer. Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/testing/ast_factory.dart
diff --git a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
index 86f1e049ba364d67706b6b12b65861cc92a4a311..f85d37a27aff03adc63cd04e6cb6f61dbe0f9cfe 100644
--- a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
@@ -46,11 +46,14 @@ class AstFactory {
new AsExpression(
expression, TokenFactory.tokenFromKeyword(Keyword.AS), type);
- static AssertStatement assertStatement(Expression condition) =>
- new AssertStatement(
+ static AssertStatement assertStatement(Expression condition,
+ [Expression message]) =>
+ new AssertStatement.withOptionalMessage(
TokenFactory.tokenFromKeyword(Keyword.ASSERT),
TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
condition,
+ message == null ? null : TokenFactory.tokenFromType(TokenType.COMMA),
+ message,
TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
TokenFactory.tokenFromType(TokenType.SEMICOLON));
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698