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

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

Issue 9568008: Do not allow native syntax on all libraries. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « dart/frog/leg/native_handler.dart ('k') | dart/frog/leg/scanner/listener.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 21 matching lines...) Expand all
32 32
33 Token position() => beginToken; 33 Token position() => beginToken;
34 34
35 bool isInterface() => beginToken.stringValue === "interface"; 35 bool isInterface() => beginToken.stringValue === "interface";
36 } 36 }
37 37
38 class MemberListener extends NodeListener { 38 class MemberListener extends NodeListener {
39 final ClassElement enclosingElement; 39 final ClassElement enclosingElement;
40 40
41 MemberListener(DiagnosticListener listener, 41 MemberListener(DiagnosticListener listener,
42 [Element this.enclosingElement = null]) 42 Element enclosingElement)
43 : super(listener); 43 : this.enclosingElement = enclosingElement,
44 super(listener, enclosingElement.getCompilationUnit());
44 45
45 bool isConstructorName(Node nameNode) { 46 bool isConstructorName(Node nameNode) {
46 if (enclosingElement === null || 47 if (enclosingElement === null ||
47 enclosingElement.kind != ElementKind.CLASS) { 48 enclosingElement.kind != ElementKind.CLASS) {
48 return false; 49 return false;
49 } 50 }
50 SourceString name; 51 SourceString name;
51 if (nameNode.asIdentifier() !== null) { 52 if (nameNode.asIdentifier() !== null) {
52 name = nameNode.asIdentifier().source; 53 name = nameNode.asIdentifier().source;
53 } else { 54 } else {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void endInitializer(Token assignmentOperator) { 124 void endInitializer(Token assignmentOperator) {
124 pushNode(null); // Super expects an expression, but 125 pushNode(null); // Super expects an expression, but
125 // ClassElementParser just skips expressions. 126 // ClassElementParser just skips expressions.
126 super.endInitializer(assignmentOperator); 127 super.endInitializer(assignmentOperator);
127 } 128 }
128 129
129 void endInitializers(int count, Token beginToken, Token endToken) { 130 void endInitializers(int count, Token beginToken, Token endToken) {
130 pushNode(null); 131 pushNode(null);
131 } 132 }
132 } 133 }
OLDNEW
« no previous file with comments | « dart/frog/leg/native_handler.dart ('k') | dart/frog/leg/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698