Chromium Code Reviews| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java |
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java |
| index fb393f76983445c4f3f92a48f6012aa0bcc3ac12..3a8fc167458a0f4e980d2451465c463530ca6911 100644 |
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java |
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java |
| @@ -1606,12 +1606,29 @@ public class Parser { |
| reportError(ParserErrorCode.EXPECTED_CLASS_MEMBER, currentToken); |
| return null; |
| } else if (matches(peek(), TokenType.OPEN_PAREN)) { |
| + SimpleIdentifier methodName = parseSimpleIdentifier(); |
|
Brian Wilkerson
2013/05/16 18:03:54
This doesn't appear to allow for named constructor
|
| + FormalParameterList parameters = parseFormalParameterList(); |
| + if (methodName.getName().equals(className)) { |
| + reportError(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, type); |
| + return parseConstructor( |
| + commentAndMetadata, |
| + modifiers.getExternalKeyword(), |
| + validateModifiersForConstructor(modifiers), |
| + modifiers.getFactoryKeyword(), |
| + methodName, |
| + null, |
| + null, |
| + parameters); |
| + } |
| validateModifiersForGetterOrSetterOrMethod(modifiers); |
| + validateFormalParameterList(parameters); |
| return parseMethodDeclaration( |
| commentAndMetadata, |
| modifiers.getExternalKeyword(), |
| modifiers.getStaticKeyword(), |
| - type); |
| + type, |
| + methodName, |
| + parameters); |
| } |
| return parseInitializedIdentifierList( |
| commentAndMetadata, |