| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library analyzer.src.summary.public_namespace_visitor; | 5 library analyzer.src.summary.public_namespace_visitor; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/src/summary/format.dart'; | 8 import 'package:analyzer/src/summary/format.dart'; |
| 9 import 'package:analyzer/src/summary/idl.dart'; | 9 import 'package:analyzer/src/summary/idl.dart'; |
| 10 | 10 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 name: name, | 140 name: name, |
| 141 kind: ReferenceKind.propertyAccessor, | 141 kind: ReferenceKind.propertyAccessor, |
| 142 numTypeParameters: 0)); | 142 numTypeParameters: 0)); |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 @override | 148 @override |
| 149 visitExportDirective(ExportDirective node) { | 149 visitExportDirective(ExportDirective node) { |
| 150 String uriStr = Uri.encodeFull(node.uri.stringValue ?? ''); | |
| 151 exports.add(new UnlinkedExportPublicBuilder( | 150 exports.add(new UnlinkedExportPublicBuilder( |
| 152 uri: uriStr, | 151 uri: node.uri.stringValue, |
| 153 combinators: node.combinators | 152 combinators: node.combinators |
| 154 .map((Combinator c) => c.accept(new _CombinatorEncoder())) | 153 .map((Combinator c) => c.accept(new _CombinatorEncoder())) |
| 155 .toList(), | 154 .toList(), |
| 156 configurations: | 155 configurations: |
| 157 node.configurations.map(serializeConfiguration).toList())); | 156 node.configurations.map(serializeConfiguration).toList())); |
| 158 } | 157 } |
| 159 | 158 |
| 160 @override | 159 @override |
| 161 visitFunctionDeclaration(FunctionDeclaration node) { | 160 visitFunctionDeclaration(FunctionDeclaration node) { |
| 162 String name = node.name.name; | 161 String name = node.name.name; |
| 163 if (node.isSetter) { | 162 if (node.isSetter) { |
| 164 name += '='; | 163 name += '='; |
| 165 } | 164 } |
| 166 addNameIfPublic( | 165 addNameIfPublic( |
| 167 name, | 166 name, |
| 168 node.isGetter || node.isSetter | 167 node.isGetter || node.isSetter |
| 169 ? ReferenceKind.topLevelPropertyAccessor | 168 ? ReferenceKind.topLevelPropertyAccessor |
| 170 : ReferenceKind.topLevelFunction, | 169 : ReferenceKind.topLevelFunction, |
| 171 node.functionExpression.typeParameters?.typeParameters?.length ?? 0); | 170 node.functionExpression.typeParameters?.typeParameters?.length ?? 0); |
| 172 } | 171 } |
| 173 | 172 |
| 174 @override | 173 @override |
| 175 visitFunctionTypeAlias(FunctionTypeAlias node) { | 174 visitFunctionTypeAlias(FunctionTypeAlias node) { |
| 176 addNameIfPublic(node.name.name, ReferenceKind.typedef, | 175 addNameIfPublic(node.name.name, ReferenceKind.typedef, |
| 177 node.typeParameters?.typeParameters?.length ?? 0); | 176 node.typeParameters?.typeParameters?.length ?? 0); |
| 178 } | 177 } |
| 179 | 178 |
| 180 @override | 179 @override |
| 181 visitPartDirective(PartDirective node) { | 180 visitPartDirective(PartDirective node) { |
| 182 String uriStr = Uri.encodeFull(node.uri.stringValue ?? ''); | 181 parts.add(node.uri.stringValue ?? ''); |
| 183 parts.add(uriStr); | |
| 184 } | 182 } |
| 185 | 183 |
| 186 @override | 184 @override |
| 187 visitVariableDeclaration(VariableDeclaration node) { | 185 visitVariableDeclaration(VariableDeclaration node) { |
| 188 String name = node.name.name; | 186 String name = node.name.name; |
| 189 addNameIfPublic(name, ReferenceKind.topLevelPropertyAccessor, 0); | 187 addNameIfPublic(name, ReferenceKind.topLevelPropertyAccessor, 0); |
| 190 if (!node.isFinal && !node.isConst) { | 188 if (!node.isFinal && !node.isConst) { |
| 191 addNameIfPublic('$name=', ReferenceKind.topLevelPropertyAccessor, 0); | 189 addNameIfPublic('$name=', ReferenceKind.topLevelPropertyAccessor, 0); |
| 192 } | 190 } |
| 193 } | 191 } |
| 194 } | 192 } |
| OLD | NEW |