Index: pkg/compiler/lib/src/parser/element_listener.dart |
diff --git a/pkg/compiler/lib/src/parser/element_listener.dart b/pkg/compiler/lib/src/parser/element_listener.dart |
index 0cdf72ed1dd720c6c44d70f65d949e73449ad4de..fb5314ef8dc8181f0f8a68b595749b786e09b431 100644 |
--- a/pkg/compiler/lib/src/parser/element_listener.dart |
+++ b/pkg/compiler/lib/src/parser/element_listener.dart |
@@ -150,12 +150,34 @@ class ElementListener extends Listener { |
if (asKeyword != null) { |
prefix = popNode(); |
} |
+ NodeList conditionalUris = popNode(); |
StringNode uri = popLiteralString(); |
- addLibraryTag(new Import(importKeyword, uri, prefix, combinators, |
+ addLibraryTag(new Import(importKeyword, uri, conditionalUris, |
+ prefix, combinators, |
popMetadata(compilationUnitElement), |
isDeferred: isDeferred)); |
} |
+ void endDottedName(int count, Token token) { |
+ NodeList identifiers = makeNodeList(count, null, null, '.'); |
+ pushNode(new DottedName(token, identifiers)); |
+ } |
+ |
+ void endConditionalUris(int count) { |
+ if (count == 0) { |
+ pushNode(null); |
+ } else { |
+ pushNode(makeNodeList(count, null, null, " ")); |
+ } |
+ } |
+ |
+ void endConditionalUri(Token ifToken, Token equalSign) { |
+ StringNode uri = popNode(); |
+ LiteralString conditionValue = (equalSign != null) ? popNode() : null; |
+ DottedName identifier = popNode(); |
+ pushNode(new ConditionalUri(ifToken, identifier, conditionValue, uri)); |
+ } |
+ |
void endEnum(Token enumKeyword, Token endBrace, int count) { |
NodeList names = makeNodeList(count, enumKeyword.next.next, endBrace, ","); |
Identifier name = popNode(); |
@@ -169,8 +191,9 @@ class ElementListener extends Listener { |
void endExport(Token exportKeyword, Token semicolon) { |
NodeList combinators = popNode(); |
+ NodeList conditionalUris = popNode(); |
StringNode uri = popNode(); |
- addLibraryTag(new Export(exportKeyword, uri, combinators, |
+ addLibraryTag(new Export(exportKeyword, uri, conditionalUris, combinators, |
popMetadata(compilationUnitElement))); |
} |