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

Side by Side Diff: pkg/analyzer/lib/src/summary/format.dart

Issue 1540493003: Information about SDK libraries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « no previous file | pkg/analyzer/tool/summary/idl.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) 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 // This file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files".
7 7
8 library analyzer.src.summary.format; 8 library analyzer.src.summary.format;
9 9
10 import 'dart:convert'; 10 import 'dart:convert';
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 return _json; 224 return _json;
225 } 225 }
226 } 226 }
227 227
228 PrelinkedUnitBuilder encodePrelinkedUnit(builder.BuilderContext builderContext, {List<PrelinkedReferenceBuilder> references}) { 228 PrelinkedUnitBuilder encodePrelinkedUnit(builder.BuilderContext builderContext, {List<PrelinkedReferenceBuilder> references}) {
229 PrelinkedUnitBuilder builder = new PrelinkedUnitBuilder(builderContext); 229 PrelinkedUnitBuilder builder = new PrelinkedUnitBuilder(builderContext);
230 builder.references = references; 230 builder.references = references;
231 return builder; 231 return builder;
232 } 232 }
233 233
234 class SdkBundle {
235 List<SdkBundleLibrary> _libraries;
236
237 SdkBundle.fromJson(Map json)
238 : _libraries = json["libraries"]?.map((x) => new SdkBundleLibrary.fromJson(x ))?.toList();
239
240 SdkBundle.fromBuffer(List<int> buffer) : this.fromJson(JSON.decode(UTF8.decode (buffer)));
241
242 List<SdkBundleLibrary> get libraries => _libraries ?? const <SdkBundleLibrary> [];
243 }
244
245 class SdkBundleBuilder {
246 final Map _json = {};
247
248 bool _finished = false;
249
250 SdkBundleBuilder(builder.BuilderContext context);
251
252 void set libraries(List<SdkBundleLibraryBuilder> _value) {
253 assert(!_finished);
254 assert(!_json.containsKey("libraries"));
255 if (_value != null || _value.isEmpty) {
256 _json["libraries"] = _value.map((b) => b.finish()).toList();
257 }
258 }
259
260 List<int> toBuffer() => UTF8.encode(JSON.encode(finish()));
261
262 Map finish() {
263 assert(!_finished);
264 _finished = true;
265 return _json;
266 }
267 }
268
269 SdkBundleBuilder encodeSdkBundle(builder.BuilderContext builderContext, {List<Sd kBundleLibraryBuilder> libraries}) {
270 SdkBundleBuilder builder = new SdkBundleBuilder(builderContext);
271 builder.libraries = libraries;
272 return builder;
273 }
274
275 class SdkBundleLibrary {
276 String _uri;
277 PrelinkedLibrary _prelinked;
278 List<UnlinkedUnit> _unlinkedUnits;
279
280 SdkBundleLibrary.fromJson(Map json)
281 : _uri = json["uri"],
282 _prelinked = json["prelinked"] == null ? null : new PrelinkedLibrary.fromJ son(json["prelinked"]),
283 _unlinkedUnits = json["unlinkedUnits"]?.map((x) => new UnlinkedUnit.fromJs on(x))?.toList();
284
285 String get uri => _uri ?? '';
286 PrelinkedLibrary get prelinked => _prelinked;
287 List<UnlinkedUnit> get unlinkedUnits => _unlinkedUnits ?? const <UnlinkedUnit> [];
288 }
289
290 class SdkBundleLibraryBuilder {
291 final Map _json = {};
292
293 bool _finished = false;
294
295 SdkBundleLibraryBuilder(builder.BuilderContext context);
296
297 void set uri(String _value) {
298 assert(!_finished);
299 assert(!_json.containsKey("uri"));
300 if (_value != null) {
301 _json["uri"] = _value;
302 }
303 }
304
305 void set prelinked(PrelinkedLibraryBuilder _value) {
306 assert(!_finished);
307 assert(!_json.containsKey("prelinked"));
308 if (_value != null) {
309 _json["prelinked"] = _value.finish();
310 }
311 }
312
313 void set unlinkedUnits(List<UnlinkedUnitBuilder> _value) {
314 assert(!_finished);
315 assert(!_json.containsKey("unlinkedUnits"));
316 if (_value != null || _value.isEmpty) {
317 _json["unlinkedUnits"] = _value.map((b) => b.finish()).toList();
318 }
319 }
320
321 Map finish() {
322 assert(!_finished);
323 _finished = true;
324 return _json;
325 }
326 }
327
328 SdkBundleLibraryBuilder encodeSdkBundleLibrary(builder.BuilderContext builderCon text, {String uri, PrelinkedLibraryBuilder prelinked, List<UnlinkedUnitBuilder> unlinkedUnits}) {
329 SdkBundleLibraryBuilder builder = new SdkBundleLibraryBuilder(builderContext);
330 builder.uri = uri;
331 builder.prelinked = prelinked;
332 builder.unlinkedUnits = unlinkedUnits;
333 return builder;
334 }
335
234 class UnlinkedClass { 336 class UnlinkedClass {
235 String _name; 337 String _name;
236 List<UnlinkedTypeParam> _typeParameters; 338 List<UnlinkedTypeParam> _typeParameters;
237 UnlinkedTypeRef _supertype; 339 UnlinkedTypeRef _supertype;
238 List<UnlinkedTypeRef> _mixins; 340 List<UnlinkedTypeRef> _mixins;
239 List<UnlinkedTypeRef> _interfaces; 341 List<UnlinkedTypeRef> _interfaces;
240 List<UnlinkedVariable> _fields; 342 List<UnlinkedVariable> _fields;
241 List<UnlinkedExecutable> _executables; 343 List<UnlinkedExecutable> _executables;
242 bool _isAbstract; 344 bool _isAbstract;
243 bool _isMixinApplication; 345 bool _isMixinApplication;
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext); 1570 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext);
1469 builder.name = name; 1571 builder.name = name;
1470 builder.type = type; 1572 builder.type = type;
1471 builder.isStatic = isStatic; 1573 builder.isStatic = isStatic;
1472 builder.isFinal = isFinal; 1574 builder.isFinal = isFinal;
1473 builder.isConst = isConst; 1575 builder.isConst = isConst;
1474 builder.hasImplicitType = hasImplicitType; 1576 builder.hasImplicitType = hasImplicitType;
1475 return builder; 1577 return builder;
1476 } 1578 }
1477 1579
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/tool/summary/idl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698