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

Side by Side Diff: pkg/kernel/lib/binary/ast_to_binary.dart

Issue 2893803003: Add metadata annotations to library definitions. (Closed)
Patch Set: 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/ast_from_binary.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.ast_to_binary; 4 library kernel.ast_to_binary;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../import_table.dart'; 7 import '../import_table.dart';
8 import 'tag.dart'; 8 import 'tag.dart';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:typed_data'; 10 import 'dart:typed_data';
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 bool insideExternalLibrary = false; 249 bool insideExternalLibrary = false;
250 250
251 visitLibrary(Library node) { 251 visitLibrary(Library node) {
252 insideExternalLibrary = node.isExternal; 252 insideExternalLibrary = node.isExternal;
253 writeByte(insideExternalLibrary ? 1 : 0); 253 writeByte(insideExternalLibrary ? 1 : 0);
254 writeCanonicalNameReference(getCanonicalNameOfLibrary(node)); 254 writeCanonicalNameReference(getCanonicalNameOfLibrary(node));
255 writeStringReference(node.name ?? ''); 255 writeStringReference(node.name ?? '');
256 // TODO(jensj): We save (almost) the same URI twice. 256 // TODO(jensj): We save (almost) the same URI twice.
257 writeUriReference(node.fileUri ?? ''); 257 writeUriReference(node.fileUri ?? '');
258 writeAnnotationList(node.annotations);
258 writeLibraryDependencies(node); 259 writeLibraryDependencies(node);
259 writeNodeList(node.typedefs); 260 writeNodeList(node.typedefs);
260 writeNodeList(node.classes); 261 writeNodeList(node.classes);
261 writeNodeList(node.fields); 262 writeNodeList(node.fields);
262 writeNodeList(node.procedures); 263 writeNodeList(node.procedures);
263 } 264 }
264 265
265 void writeLibraryDependencies(Library library) { 266 void writeLibraryDependencies(Library library) {
266 _libraryDependencyIndex = library.dependencies.isEmpty 267 _libraryDependencyIndex = library.dependencies.isEmpty
267 ? const <LibraryDependency, int>{} 268 ? const <LibraryDependency, int>{}
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 _sink.add(_buffer.sublist(0, length)); 1405 _sink.add(_buffer.sublist(0, length));
1405 _buffer = new Uint8List(SIZE); 1406 _buffer = new Uint8List(SIZE);
1406 flushedLength += length; 1407 flushedLength += length;
1407 length = 0; 1408 length = 0;
1408 } 1409 }
1409 1410
1410 void flushAndDestroy() { 1411 void flushAndDestroy() {
1411 _sink.add(_buffer.sublist(0, length)); 1412 _sink.add(_buffer.sublist(0, length));
1412 } 1413 }
1413 } 1414 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/binary/ast_from_binary.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