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

Side by Side Diff: pkg/compiler/lib/src/scanner/scanner_task.dart

Issue 1803303002: Move all flags to CompilerOptions (first step to stop passing the compiler to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « pkg/compiler/lib/src/resolution/signatures.dart ('k') | pkg/compiler/lib/src/ssa/builder.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.scanner.task; 5 library dart2js.scanner.task;
6 6
7 import '../common/tasks.dart' show 7 import '../common/tasks.dart' show
8 CompilerTask; 8 CompilerTask;
9 import '../compiler.dart' show 9 import '../compiler.dart' show
10 Compiler; 10 Compiler;
(...skipping 28 matching lines...) Expand all
39 39
40 void scan(CompilationUnitElement compilationUnit) { 40 void scan(CompilationUnitElement compilationUnit) {
41 measure(() { 41 measure(() {
42 scanElements(compilationUnit); 42 scanElements(compilationUnit);
43 }); 43 });
44 } 44 }
45 45
46 void scanElements(CompilationUnitElement compilationUnit) { 46 void scanElements(CompilationUnitElement compilationUnit) {
47 Script script = compilationUnit.script; 47 Script script = compilationUnit.script;
48 Token tokens = new Scanner(script.file, 48 Token tokens = new Scanner(script.file,
49 includeComments: compiler.preserveComments).tokenize(); 49 includeComments: compiler.options.preserveComments).tokenize();
50 if (compiler.preserveComments) { 50 if (compiler.options.preserveComments) {
51 tokens = compiler.processAndStripComments(tokens); 51 tokens = compiler.processAndStripComments(tokens);
52 } 52 }
53 compiler.dietParser.dietParse(compilationUnit, tokens); 53 compiler.dietParser.dietParse(compilationUnit, tokens);
54 } 54 }
55 55
56 /** 56 /**
57 * Returns the tokens for the [source]. 57 * Returns the tokens for the [source].
58 * 58 *
59 * The [StringScanner] implementation works on strings that end with a '0' 59 * The [StringScanner] implementation works on strings that end with a '0'
60 * value ('\x00'). If [source] does not end with '0', the string is copied 60 * value ('\x00'). If [source] does not end with '0', the string is copied
61 * before scanning. 61 * before scanning.
62 */ 62 */
63 Token tokenize(String source) { 63 Token tokenize(String source) {
64 return measure(() { 64 return measure(() {
65 return new StringScanner.fromString(source, includeComments: false) 65 return new StringScanner.fromString(source, includeComments: false)
66 .tokenize(); 66 .tokenize();
67 }); 67 });
68 } 68 }
69 } 69 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/signatures.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698