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

Side by Side Diff: pkg/kernel/lib/canonical_name.dart

Issue 2825053002: Add typedef AST node boilerplate. (Closed)
Patch Set: Update FastaVerifyingVisitor to work with the changes in VerifyingVisitor Created 3 years, 7 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
« no previous file with comments | « pkg/kernel/lib/binary/tag.dart ('k') | pkg/kernel/lib/text/ast_to_text.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library kernel.canonical_name; 4 library kernel.canonical_name;
5 5
6 import 'ast.dart'; 6 import 'ast.dart';
7 7
8 /// A string sequence that identifies a library, class, or member. 8 /// A string sequence that identifies a library, class, or member.
9 /// 9 ///
10 /// Canonical names are organized in a prefix tree. Each node knows its 10 /// Canonical names are organized in a prefix tree. Each node knows its
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return name.isPrivate 97 return name.isPrivate
98 ? getChildFromUri(name.library.importUri).getChild(name.name) 98 ? getChildFromUri(name.library.importUri).getChild(name.name)
99 : getChild(name.name); 99 : getChild(name.name);
100 } 100 }
101 101
102 CanonicalName getChildFromMember(Member member) { 102 CanonicalName getChildFromMember(Member member) {
103 return getChild(getMemberQualifier(member)) 103 return getChild(getMemberQualifier(member))
104 .getChildFromQualifiedName(member.name); 104 .getChildFromQualifiedName(member.name);
105 } 105 }
106 106
107 CanonicalName getChildFromTypedef(Typedef typedef_) {
108 return getChild('@typedefs').getChild(typedef_.name);
109 }
110
107 void bindTo(Reference target) { 111 void bindTo(Reference target) {
108 if (reference == target) return; 112 if (reference == target) return;
109 if (reference != null) { 113 if (reference != null) {
110 throw '$this is already bound'; 114 throw '$this is already bound';
111 } 115 }
112 if (target.canonicalName != null) { 116 if (target.canonicalName != null) {
113 throw 'Cannot bind $this to ${target.node}, target is already bound to ' 117 throw 'Cannot bind $this to ${target.node}, target is already bound to '
114 '${target.canonicalName}'; 118 '${target.canonicalName}';
115 } 119 }
116 target.canonicalName = this; 120 target.canonicalName = this;
(...skipping 29 matching lines...) Expand all
146 } 150 }
147 if (member is Field) { 151 if (member is Field) {
148 return '@fields'; 152 return '@fields';
149 } 153 }
150 if (member is Constructor) { 154 if (member is Constructor) {
151 return '@constructors'; 155 return '@constructors';
152 } 156 }
153 throw 'Unexpected member: $member'; 157 throw 'Unexpected member: $member';
154 } 158 }
155 } 159 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/binary/tag.dart ('k') | pkg/kernel/lib/text/ast_to_text.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698