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

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 1851753002: Enable conditional directives by default. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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) 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 analyzer.src.task.dart; 5 library analyzer.src.task.dart;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 3428 matching lines...) Expand 10 before | Expand all | Expand 10 after
3439 LineInfo lineInfo = getRequiredInput(LINE_INFO_INPUT_NAME); 3439 LineInfo lineInfo = getRequiredInput(LINE_INFO_INPUT_NAME);
3440 int modificationTime = getRequiredInput(MODIFICATION_TIME_INPUT_NAME); 3440 int modificationTime = getRequiredInput(MODIFICATION_TIME_INPUT_NAME);
3441 Token tokenStream = getRequiredInput(TOKEN_STREAM_INPUT_NAME); 3441 Token tokenStream = getRequiredInput(TOKEN_STREAM_INPUT_NAME);
3442 3442
3443 RecordingErrorListener errorListener = new RecordingErrorListener(); 3443 RecordingErrorListener errorListener = new RecordingErrorListener();
3444 Parser parser = new Parser(source, errorListener); 3444 Parser parser = new Parser(source, errorListener);
3445 AnalysisOptions options = context.analysisOptions; 3445 AnalysisOptions options = context.analysisOptions;
3446 parser.parseAsync = options.enableAsync; 3446 parser.parseAsync = options.enableAsync;
3447 parser.parseFunctionBodies = options.analyzeFunctionBodiesPredicate(source); 3447 parser.parseFunctionBodies = options.analyzeFunctionBodiesPredicate(source);
3448 parser.parseGenericMethods = options.enableGenericMethods; 3448 parser.parseGenericMethods = options.enableGenericMethods;
3449 parser.parseConditionalDirectives = options.enableConditionalDirectives;
3450 parser.parseGenericMethodComments = options.strongMode; 3449 parser.parseGenericMethodComments = options.strongMode;
3451 CompilationUnit unit = parser.parseCompilationUnit(tokenStream); 3450 CompilationUnit unit = parser.parseCompilationUnit(tokenStream);
3452 unit.lineInfo = lineInfo; 3451 unit.lineInfo = lineInfo;
3453 3452
3454 bool hasNonPartOfDirective = false; 3453 bool hasNonPartOfDirective = false;
3455 bool hasPartOfDirective = false; 3454 bool hasPartOfDirective = false;
3456 HashSet<Source> explicitlyImportedSourceSet = new HashSet<Source>(); 3455 HashSet<Source> explicitlyImportedSourceSet = new HashSet<Source>();
3457 HashSet<Source> exportedSourceSet = new HashSet<Source>(); 3456 HashSet<Source> exportedSourceSet = new HashSet<Source>();
3458 HashSet<Source> includedSourceSet = new HashSet<Source>(); 3457 HashSet<Source> includedSourceSet = new HashSet<Source>();
3459 for (Directive directive in unit.directives) { 3458 for (Directive directive in unit.directives) {
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after
5354 5353
5355 @override 5354 @override
5356 bool moveNext() { 5355 bool moveNext() {
5357 if (_newSources.isEmpty) { 5356 if (_newSources.isEmpty) {
5358 return false; 5357 return false;
5359 } 5358 }
5360 currentTarget = _newSources.removeLast(); 5359 currentTarget = _newSources.removeLast();
5361 return true; 5360 return true;
5362 } 5361 }
5363 } 5362 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698