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

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

Issue 973433003: Initial cut for a development server (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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/code_generator.dart ('k') | lib/src/codegen/html_codegen.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 ddc.src.codegen.dart_codegen; 5 library ddc.src.codegen.dart_codegen;
6 6
7 import 'dart:io' show File; 7 import 'dart:io' show File;
8 8
9 import 'package:analyzer/analyzer.dart' as analyzer; 9 import 'package:analyzer/analyzer.dart' as analyzer;
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 } 478 }
479 } 479 }
480 480
481 // This class emits the code unchanged, for comparison purposes. 481 // This class emits the code unchanged, for comparison purposes.
482 class EmptyDartGenerator extends codegenerator.CodeGenerator { 482 class EmptyDartGenerator extends codegenerator.CodeGenerator {
483 final CompilerOptions options; 483 final CompilerOptions options;
484 484
485 EmptyDartGenerator(String outDir, Uri root, TypeRules rules, this.options) 485 EmptyDartGenerator(String outDir, Uri root, TypeRules rules, this.options)
486 : super(outDir, root, rules); 486 : super(outDir, root, rules);
487 487
488 void generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
489 CheckerReporter reporter) {
490 for (var unit in units) {
491 var outputDir = makeOutputDirectory(info, unit);
492 reporter.enterSource(unit.element.source);
493 generateUnit(unit, info, outputDir);
494 reporter.leaveSource();
495 }
496 }
497
488 void generateUnit(CompilationUnit unit, LibraryInfo info, String libraryDir) { 498 void generateUnit(CompilationUnit unit, LibraryInfo info, String libraryDir) {
489 var uri = unit.element.source.uri; 499 var uri = unit.element.source.uri;
490 _log.fine("Emitting original unit " + uri.toString()); 500 _log.fine("Emitting original unit " + uri.toString());
491 FileWriter out = new FileWriter( 501 FileWriter out = new FileWriter(
492 options, path.join(libraryDir, '${uri.pathSegments.last}')); 502 options, path.join(libraryDir, '${uri.pathSegments.last}'));
493 var unitGen = new EmptyUnitGenerator(unit, out); 503 var unitGen = new EmptyUnitGenerator(unit, out);
494 unitGen.generate(); 504 unitGen.generate();
495 out.finalize(); 505 out.finalize();
496 } 506 }
497 } 507 }
OLDNEW
« no previous file with comments | « lib/src/codegen/code_generator.dart ('k') | lib/src/codegen/html_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698