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

Side by Side Diff: lib/src/codegen/html_codegen.dart

Issue 1148283010: Remove dart backend (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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 | « lib/src/codegen/dart_codegen.dart ('k') | lib/src/options.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 library dev_compiler.src.codegen.html_codegen; 5 library dev_compiler.src.codegen.html_codegen;
6 6
7 import 'package:html/dom.dart'; 7 import 'package:html/dom.dart';
8 import 'package:html/parser.dart' show parseFragment; 8 import 'package:html/parser.dart' show parseFragment;
9 import 'package:logging/logging.dart' show Logger; 9 import 'package:logging/logging.dart' show Logger;
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 scripts.skip(1).forEach((s) { 34 scripts.skip(1).forEach((s) {
35 // TODO(sigmund): allow more than one Dart script tags? 35 // TODO(sigmund): allow more than one Dart script tags?
36 _log.warning(s.sourceSpan.message( 36 _log.warning(s.sourceSpan.message(
37 'unexpected script. Only one Dart script tag allowed ' 37 'unexpected script. Only one Dart script tag allowed '
38 '(see https://github.com/dart-lang/dart-dev-compiler/issues/53).', 38 '(see https://github.com/dart-lang/dart-dev-compiler/issues/53).',
39 color: options.useColors ? colorOf('warning') : false)); 39 color: options.useColors ? colorOf('warning') : false));
40 s.remove(); 40 s.remove();
41 }); 41 });
42 42
43 if (options.outputDart) return '${document.outerHtml}\n';
44
45 var libraries = []; 43 var libraries = [];
46 var resources = new Set(); 44 var resources = new Set();
47 visitInPostOrder(root, (n) { 45 visitInPostOrder(root, (n) {
48 if (n is DartSourceNode) libraries.add(n); 46 if (n is DartSourceNode) libraries.add(n);
49 if (n is ResourceSourceNode) resources.add(n); 47 if (n is ResourceSourceNode) resources.add(n);
50 }, includeParts: false); 48 }, includeParts: false);
51 49
52 root.htmlResourceNodes.forEach((element, resource) { 50 root.htmlResourceNodes.forEach((element, resource) {
53 // Make sure we don't try and add this node again. 51 // Make sure we don't try and add this node again.
54 resources.remove(resource); 52 resources.remove(resource);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 110
113 /// Convert the outputPath to include the hash in it. This function is the 111 /// Convert the outputPath to include the hash in it. This function is the
114 /// reverse of what the server does to determine whether a request needs to have 112 /// reverse of what the server does to determine whether a request needs to have
115 /// cache headers added to it. 113 /// cache headers added to it.
116 _addHash(String outPath, String hash) { 114 _addHash(String outPath, String hash) {
117 // (the ____ prefix makes it look better in the web inspector) 115 // (the ____ prefix makes it look better in the web inspector)
118 return '$outPath?____cached=$hash'; 116 return '$outPath?____cached=$hash';
119 } 117 }
120 118
121 final _log = new Logger('dev_compiler.src.codegen.html_codegen'); 119 final _log = new Logger('dev_compiler.src.codegen.html_codegen');
OLDNEW
« no previous file with comments | « lib/src/codegen/dart_codegen.dart ('k') | lib/src/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698