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

Side by Side Diff: pkg/analyzer/lib/src/codegen/tools.dart

Issue 1855643002: More strong mode changes to analysis_server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Backout changes to options file Created 4 years, 8 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 * Tools for generating code in analyzer and analysis server. 6 * Tools for generating code in analyzer and analysis server.
7 */ 7 */
8 library analyzer.src.codegen.tools; 8 library analyzer.src.codegen.tools;
9 9
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 return _state.buffer; 504 return _state.buffer;
505 } finally { 505 } finally {
506 _state = oldState; 506 _state = oldState;
507 } 507 }
508 } 508 }
509 509
510 /** 510 /**
511 * Execute [callback], wrapping its output in an element with the given 511 * Execute [callback], wrapping its output in an element with the given
512 * [name] and [attributes]. 512 * [name] and [attributes].
513 */ 513 */
514 void element(String name, Map<String, String> attributes, [void callback()]) { 514 void element(String name, Map<dynamic, String> attributes,
515 [void callback()]) {
515 add(makeElement(name, attributes, collectHtml(callback))); 516 add(makeElement(name, attributes, collectHtml(callback)));
516 } 517 }
517 518
518 /** 519 /**
519 * Execute [callback], indenting any code it outputs by two spaces. 520 * Execute [callback], indenting any code it outputs by two spaces.
520 */ 521 */
521 void indent(void callback()) { 522 void indent(void callback()) {
522 String oldIndent = _state.indent; 523 String oldIndent = _state.indent;
523 try { 524 try {
524 _state.indent += ' '; 525 _state.indent += ' ';
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 if (lines.last.isEmpty) { 600 if (lines.last.isEmpty) {
600 lines.removeLast(); 601 lines.removeLast();
601 buffer.add(new dom.Text(lines.join('\n$indent') + '\n')); 602 buffer.add(new dom.Text(lines.join('\n$indent') + '\n'));
602 indentNeeded = true; 603 indentNeeded = true;
603 } else { 604 } else {
604 buffer.add(new dom.Text(lines.join('\n$indent'))); 605 buffer.add(new dom.Text(lines.join('\n$indent')));
605 indentNeeded = false; 606 indentNeeded = false;
606 } 607 }
607 } 608 }
608 } 609 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/source/caching_put_package_map_provider_test.dart ('k') | pkg/analyzer/lib/src/context/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698