| Index: lib/compiler/implementation/scanner/listener.dart
|
| diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
|
| index 2017961c5a8ed5f4ebd4e522d21fd37284dceb12..6c5d3cda05184f6a5cdb5bdda57fc0cce871e5ab 100644
|
| --- a/lib/compiler/implementation/scanner/listener.dart
|
| +++ b/lib/compiler/implementation/scanner/listener.dart
|
| @@ -268,6 +268,18 @@ class Listener {
|
| void endPartOf(Token partKeyword, Token semicolon) {
|
| }
|
|
|
| + void beginQualifiedList(Token start) {
|
| + }
|
| +
|
| + void endQualifiedList(int count) {
|
| + }
|
| +
|
| + void beginRedirectingFactoryBody(Token token) {
|
| + }
|
| +
|
| + void endRedirectingFactoryBody(Token beginToken, Token endToken) {
|
| + }
|
| +
|
| void beginReturnStatement(Token token) {
|
| }
|
|
|
| @@ -1207,6 +1219,16 @@ class NodeListener extends ElementListener {
|
| pushNode(null);
|
| }
|
|
|
| + void endQualifiedList(int count) {
|
| + pushNode(makeNodeList(count, null, null, "."));
|
| + }
|
| +
|
| + void endRedirectingFactoryBody(Token beginToken,
|
| + Token endToken) {
|
| + NodeList qualifiedList = popNode();
|
| + pushNode(new Return(beginToken, endToken, qualifiedList));
|
| + }
|
| +
|
| void endReturnStatement(bool hasExpression,
|
| Token beginToken, Token endToken) {
|
| Expression expression = hasExpression ? popNode() : null;
|
| @@ -1634,14 +1656,25 @@ class NodeListener extends ElementListener {
|
| // A library prefix was handled in [handleQualified].
|
| name = new Send(popNode(), name);
|
| }
|
| - handleModifier(startKeyword);
|
| - if (startKeyword.stringValue === 'external') {
|
| - handleModifier(startKeyword.next);
|
| - handleModifiers(2);
|
| - } else {
|
| - handleModifiers(1);
|
| + // TODO(ahe): Move this parsing to the parser.
|
| + int modifierCount = 0;
|
| + Token modifier = startKeyword;
|
| + if (modifier.stringValue == "external") {
|
| + handleModifier(modifier);
|
| + modifierCount++;
|
| + modifier = modifier.next;
|
| + }
|
| + if (modifier.stringValue == "const") {
|
| + handleModifier(modifier);
|
| + modifierCount++;
|
| + modifier = modifier.next;
|
| }
|
| + assert(modifier.stringValue == "factory");
|
| + handleModifier(modifier);
|
| + modifierCount++;
|
| + handleModifiers(modifierCount);
|
| Modifiers modifiers = popNode();
|
| +
|
| pushNode(new FunctionExpression(name, formals, body, null,
|
| modifiers, null, null));
|
| }
|
|
|