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

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 1584823003: assert isAsynchronous and isGenerator false if parseAsync is false (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 de0306f68f7c9a3cc8eca99b9598f94f1bbd2b18..9774a7331e8191f050417d6347cfe1252ec51510 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -6101,9 +6101,13 @@ class Parser {
keyword = getAndAdvance();
if (!_parseAsync) {
_reportErrorForToken(ParserErrorCode.ASYNC_NOT_SUPPORTED, keyword);
+ keyword = null;
Brian Wilkerson 2016/01/13 21:38:01 I don't think we want to make these changes to the
danrubel 2016/01/13 22:02:20 Yes. There are a number of places in the resolver
}
if (_matches(TokenType.STAR)) {
star = getAndAdvance();
+ if (!_parseAsync) {
+ star = null;
+ }
_inGenerator = true;
}
_inAsync = true;
@@ -6111,9 +6115,13 @@ class Parser {
keyword = getAndAdvance();
if (!_parseAsync) {
_reportErrorForToken(ParserErrorCode.ASYNC_NOT_SUPPORTED, keyword);
+ keyword = null;
}
if (_matches(TokenType.STAR)) {
star = getAndAdvance();
+ if (!_parseAsync) {
+ star = null;
+ }
_inGenerator = true;
}
}
@@ -9381,8 +9389,8 @@ class ParserErrorCode extends ErrorCode {
/**
* Some environments, such as Fletch, do not support async.
*/
- static const CompileTimeErrorCode ASYNC_NOT_SUPPORTED =
- const CompileTimeErrorCode('ASYNC_NOT_SUPPORTED',
+ static const ParserErrorCode ASYNC_NOT_SUPPORTED =
+ const ParserErrorCode('ASYNC_NOT_SUPPORTED',
"Async and sync are not supported in this environment.");
static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = const ParserErrorCode(
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698