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

Side by Side Diff: pkg/analyzer/tool/summary/generate.dart

Issue 2875373002: Move flat_buffer and api_signature into front_end. (Closed)
Patch Set: Update summary format generator. 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
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 /** 5 /**
6 * This file contains code to generate serialization/deserialization logic for 6 * This file contains code to generate serialization/deserialization logic for
7 * summaries based on an "IDL" description of the summary format (written in 7 * summaries based on an "IDL" description of the summary format (written in
8 * stylized Dart). 8 * stylized Dart).
9 * 9 *
10 * For each class in the "IDL" input, two corresponding classes are generated: 10 * For each class in the "IDL" input, two corresponding classes are generated:
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 426 }
427 } 427 }
428 428
429 /** 429 /**
430 * Entry point to the code generator when generating the "format.dart" file. 430 * Entry point to the code generator when generating the "format.dart" file.
431 */ 431 */
432 void generateFormatCode() { 432 void generateFormatCode() {
433 outputHeader(); 433 outputHeader();
434 out('library analyzer.src.summary.format;'); 434 out('library analyzer.src.summary.format;');
435 out(); 435 out();
436 out("import 'flat_buffers.dart' as fb;"); 436 out("import 'dart:convert' as convert;");
437 out();
438 out("import 'package:front_end/src/base/api_signature.dart' as api_sig;");
439 out("import 'package:front_end/src/base/flat_buffers.dart' as fb;");
440 out();
437 out("import 'idl.dart' as idl;"); 441 out("import 'idl.dart' as idl;");
438 out("import 'dart:convert' as convert;");
439 out("import 'api_signature.dart' as api_sig;");
440 out(); 442 out();
441 for (idlModel.EnumDeclaration enm in _idl.enums.values) { 443 for (idlModel.EnumDeclaration enm in _idl.enums.values) {
442 _generateEnumReader(enm); 444 _generateEnumReader(enm);
443 out(); 445 out();
444 } 446 }
445 for (idlModel.ClassDeclaration cls in _idl.classes.values) { 447 for (idlModel.ClassDeclaration cls in _idl.classes.values) {
446 _generateBuilder(cls); 448 _generateBuilder(cls);
447 out(); 449 out();
448 if (cls.isTopLevel) { 450 if (cls.isTopLevel) {
449 _generateReadFunction(cls); 451 _generateReadFunction(cls);
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 Token token = comment.tokens.first; 1007 Token token = comment.tokens.first;
1006 return token.lexeme.split('\n').map((String line) { 1008 return token.lexeme.split('\n').map((String line) {
1007 line = line.trimLeft(); 1009 line = line.trimLeft();
1008 if (line.startsWith('*')) line = ' ' + line; 1010 if (line.startsWith('*')) line = ' ' + line;
1009 return line; 1011 return line;
1010 }).join('\n'); 1012 }).join('\n');
1011 } 1013 }
1012 return null; 1014 return null;
1013 } 1015 }
1014 } 1016 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/test_all.dart ('k') | pkg/front_end/lib/src/base/api_signature.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698