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

Side by Side Diff: frog/leg/scanner/class_element_parser.dart

Issue 9211005: Support static/global field initializations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 4 space indent. Created 8 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class ClassElementParser extends PartialParser { 5 class ClassElementParser extends PartialParser {
6 ClassElementParser(Listener listener) : super(listener); 6 ClassElementParser(Listener listener) : super(listener);
7 7
8 Token parseClassBody(Token token) => fullParseClassBody(token); 8 Token parseClassBody(Token token) => fullParseClassBody(token);
9 } 9 }
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 Modifiers modifiers = variableDefinitions.modifiers; 81 Modifiers modifiers = variableDefinitions.modifiers;
82 pushNode(null); 82 pushNode(null);
83 void buildFieldElement(SourceString name, Node node, Element fields) { 83 void buildFieldElement(SourceString name, Node node, Element fields) {
84 Element element = new VariableElement( 84 Element element = new VariableElement(
85 name, node, fields, ElementKind.FIELD, enclosingElement); 85 name, node, fields, ElementKind.FIELD, enclosingElement);
86 enclosingElement.addMember(element); 86 enclosingElement.addMember(element);
87 } 87 }
88 buildFieldElements(modifiers, variableDefinitions.definitions, 88 buildFieldElements(modifiers, variableDefinitions.definitions,
89 buildFieldElement, beginToken, endToken); 89 buildFieldElement, beginToken, endToken);
90 } 90 }
91
92 void endInitializer(Token assignmentOperator) {
93 // TODO(floitsch): Remove this cancel.
94 canceler.cancel("field initializers are not implemented",
95 token: assignmentOperator);
96 pushNode(null); // Super expects an expression, but
97 // ClassElementParser just skips expressions.
98 super.endInitializer(assignmentOperator);
99 }
100
101 void endInitializers(int count, Token beginToken, Token endToken) {
102 pushNode(null);
103 }
104 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698