Chromium Code Reviews| Index: frog/leg/scanner/class_element_parser.dart |
| =================================================================== |
| --- frog/leg/scanner/class_element_parser.dart (revision 2746) |
| +++ frog/leg/scanner/class_element_parser.dart (working copy) |
| @@ -48,7 +48,7 @@ |
| pushNode(null); |
| Identifier name = method.name; // TODO(ahe): Named constructors. |
| ElementKind kind = isConstructor(name) ? |
| - ElementKind.CONSTRUCTOR : |
| + ElementKind.GENERATIVE_CONSTRUCTOR : |
| ElementKind.FUNCTION; |
| Element memberElement = |
| new PartialFunctionElement(name.source, beginToken, endToken, |
| @@ -56,6 +56,20 @@ |
| enclosingElement.addMember(memberElement); |
| } |
| + void endFactoryMethod(Token factoryKeyword, Token periodBeforeName, |
| + Token endToken) { |
| + super.endFactoryMethod(factoryKeyword, periodBeforeName, endToken); |
| + FunctionExpression method = popNode(); |
| + pushNode(null); |
| + // TODO(ahe): Named constructors. |
| + Identifier name = method.returnType.typeName; |
|
ahe
2011/12/22 13:32:39
You need to change this now. The return type is al
ngeoffray
2011/12/22 13:50:23
Done.
|
| + ElementKind kind = ElementKind.FUNCTION; |
| + Element memberElement = |
| + new PartialFunctionElement(name.source, factoryKeyword, endToken, kind, |
| + method.modifiers, enclosingElement); |
| + enclosingElement.addMember(memberElement); |
| + } |
| + |
| void endFields(int count, Token beginToken, Token endToken) { |
| super.endFields(count, beginToken, endToken); |
| VariableDefinitions variableDefinitions = popNode(); |