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

Unified Diff: pkg/compiler/lib/src/parser/parser.dart

Issue 1517013003: Revert "dart2js: add support for configuration-specific imports." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/compiler/lib/src/parser/listener.dart ('k') | pkg/compiler/lib/src/parser/parser_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/parser.dart
diff --git a/pkg/compiler/lib/src/parser/parser.dart b/pkg/compiler/lib/src/parser/parser.dart
index f2e0577937e91946b398e1e8040ae978ff95a8ae..942e121cf718045a5c552f5d3c18de42b64af2f4 100644
--- a/pkg/compiler/lib/src/parser/parser.dart
+++ b/pkg/compiler/lib/src/parser/parser.dart
@@ -98,12 +98,10 @@ class FormalParameterType {
class Parser {
final Listener listener;
bool mayParseFunctionExpressions = true;
- final bool enableConditionalDirectives;
bool asyncAwaitKeywordsEnabled;
Parser(this.listener,
- {this.enableConditionalDirectives: false,
- this.asyncAwaitKeywordsEnabled: false});
+ {this.asyncAwaitKeywordsEnabled: false});
Token parseUnit(Token token) {
listener.beginCompilationUnit(token);
@@ -152,13 +150,12 @@ class Parser {
return token;
}
- /// import uri (if (test) uri)* (as identifier)? combinator* ';'
+ /// import uri (as identifier)? combinator* ';'
Token parseImport(Token token) {
Token importKeyword = token;
listener.beginImport(importKeyword);
assert(optional('import', token));
token = parseLiteralStringOrRecoverExpression(token.next);
- token = parseConditionalUris(token);
Token deferredKeyword;
if (optional('deferred', token)) {
deferredKeyword = token;
@@ -176,57 +173,12 @@ class Parser {
return token;
}
- /// if (test) uri
- Token parseConditionalUris(Token token) {
- listener.beginConditionalUris(token);
- int count = 0;
- if (enableConditionalDirectives) {
- while (optional('if', token)) {
- count++;
- token = parseConditionalUri(token);
- }
- }
- listener.endConditionalUris(count);
- return token;
- }
-
- Token parseConditionalUri(Token token) {
- listener.beginConditionalUri(token);
- Token ifKeyword = token;
- token = expect('if', token);
- token = expect('(', token);
- token = parseDottedName(token);
- Token equalitySign;
- if (optional('==', token)) {
- equalitySign = token;
- token = parseLiteralStringOrRecoverExpression(token.next);
- }
- token = expect(')', token);
- token = parseLiteralStringOrRecoverExpression(token);
- listener.endConditionalUri(ifKeyword, equalitySign);
- return token;
- }
-
- Token parseDottedName(Token token) {
- listener.beginDottedName(token);
- Token firstIdentifier = token;
- token = parseIdentifier(token);
- int count = 1;
- while (optional('.', token)) {
- token = parseIdentifier(token.next);
- count++;
- }
- listener.endDottedName(count, firstIdentifier);
- return token;
- }
-
- /// export uri conditional-uris* combinator* ';'
+ /// export uri combinator* ';'
Token parseExport(Token token) {
Token exportKeyword = token;
listener.beginExport(exportKeyword);
assert(optional('export', token));
token = parseLiteralStringOrRecoverExpression(token.next);
- token = parseConditionalUris(token);
token = parseCombinators(token);
Token semicolon = token;
token = expect(';', token);
« no previous file with comments | « pkg/compiler/lib/src/parser/listener.dart ('k') | pkg/compiler/lib/src/parser/parser_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698