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

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

Issue 842503003: Enable async support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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
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 ed6c1ad26a7210fa4b98edbf251edbcc6d505e87..a6ebecf33782269630193ee2a1ef7440e0a974c8 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -2272,11 +2272,6 @@ class Parser {
bool _parseFunctionBodies = true;
/**
- * A flag indicating whether the parser is to parse the async support.
- */
- bool _parseAsync = AnalysisOptionsImpl.DEFAULT_ENABLE_ASYNC;
-
- /**
* A flag indicating whether the parser is to parse deferred libraries.
*/
bool _parseDeferredLibraries =
@@ -2359,15 +2354,6 @@ class Parser {
}
/**
- * Set whether the parser is to parse the async support.
- *
- * @param parseAsync `true` if the parser is to parse the async support
- */
- void set parseAsync(bool parseAsync) {
- this._parseAsync = parseAsync;
- }
-
- /**
* Set whether the parser is to parse deferred libraries.
*
* @param parseDeferredLibraries `true` if the parser is to parse deferred libraries
@@ -4394,11 +4380,8 @@ class Parser {
[TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) {
return true;
}
- if (_parseAsync) {
- String lexeme = afterParameters.lexeme;
- return lexeme == ASYNC || lexeme == SYNC;
- }
- return false;
+ String lexeme = afterParameters.lexeme;
+ return lexeme == ASYNC || lexeme == SYNC;
}
/**
@@ -6525,20 +6508,18 @@ class Parser {
}
Token keyword = null;
Token star = null;
- if (_parseAsync) {
- if (_matchesString(ASYNC)) {
- keyword = getAndAdvance();
- if (_matches(TokenType.STAR)) {
- star = getAndAdvance();
- _inGenerator = true;
- }
- _inAsync = true;
- } else if (_matchesString(SYNC)) {
- keyword = getAndAdvance();
- if (_matches(TokenType.STAR)) {
- star = getAndAdvance();
- _inGenerator = true;
- }
+ if (_matchesString(ASYNC)) {
+ keyword = getAndAdvance();
+ if (_matches(TokenType.STAR)) {
+ star = getAndAdvance();
+ _inGenerator = true;
+ }
+ _inAsync = true;
+ } else if (_matchesString(SYNC)) {
+ keyword = getAndAdvance();
+ if (_matches(TokenType.STAR)) {
+ star = getAndAdvance();
+ _inGenerator = true;
}
}
if (_matches(TokenType.FUNCTION)) {
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698