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

Side by Side Diff: pkg/analyzer/lib/src/generated/parser.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) 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 library analyzer.src.generated.parser; 5 library analyzer.src.generated.parser;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 */ 2162 */
2163 bool _inSwitch = false; 2163 bool _inSwitch = false;
2164 2164
2165 /** 2165 /**
2166 * A flag indicating whether the parser is currently in a constructor field 2166 * A flag indicating whether the parser is currently in a constructor field
2167 * initializer, with no intervening parens, braces, or brackets. 2167 * initializer, with no intervening parens, braces, or brackets.
2168 */ 2168 */
2169 bool _inInitializer = false; 2169 bool _inInitializer = false;
2170 2170
2171 /** 2171 /**
2172 * A flag indicating whether the parser is to parse conditional directives
2173 * syntax.
2174 */
2175 bool parseConditionalDirectives = false;
2176
2177 /**
2178 * A flag indicating whether the parser is to parse generic method syntax. 2172 * A flag indicating whether the parser is to parse generic method syntax.
2179 */ 2173 */
2180 bool parseGenericMethods = false; 2174 bool parseGenericMethods = false;
2181 2175
2182 /** 2176 /**
2183 * A flag indicating whether to parse generic method comments, of the form 2177 * A flag indicating whether to parse generic method comments, of the form
2184 * `/*=T*/` and `/*<T>*/`. 2178 * `/*=T*/` and `/*<T>*/`.
2185 */ 2179 */
2186 bool parseGenericMethodComments = false; 2180 bool parseGenericMethodComments = false;
2187 2181
(...skipping 3165 matching lines...) Expand 10 before | Expand all | Expand 10 after
5353 return new Configuration(ifKeyword, leftParenthesis, name, equalToken, 5347 return new Configuration(ifKeyword, leftParenthesis, name, equalToken,
5354 value, rightParenthesis, libraryUri); 5348 value, rightParenthesis, libraryUri);
5355 } 5349 }
5356 5350
5357 /** 5351 /**
5358 * Parse a list of configurations. If conditional directives are not 5352 * Parse a list of configurations. If conditional directives are not
5359 * supported, return an empty list without attempting to parse anything. 5353 * supported, return an empty list without attempting to parse anything.
5360 */ 5354 */
5361 List<Configuration> _parseConfigurations() { 5355 List<Configuration> _parseConfigurations() {
5362 List<Configuration> configurations = <Configuration>[]; 5356 List<Configuration> configurations = <Configuration>[];
5363 if (parseConditionalDirectives) { 5357 while (_matchesKeyword(Keyword.IF)) {
5364 while (_matchesKeyword(Keyword.IF)) { 5358 configurations.add(_parseConfiguration());
5365 configurations.add(_parseConfiguration());
5366 }
5367 } 5359 }
5368 return configurations; 5360 return configurations;
5369 } 5361 }
5370 5362
5371 /** 5363 /**
5372 * Parse a const expression. Return the const expression that was parsed. 5364 * Parse a const expression. Return the const expression that was parsed.
5373 * 5365 *
5374 * constExpression ::= 5366 * constExpression ::=
5375 * instanceCreationExpression 5367 * instanceCreationExpression
5376 * | listLiteral 5368 * | listLiteral
(...skipping 4580 matching lines...) Expand 10 before | Expand all | Expand 10 after
9957 */ 9949 */
9958 const ParserErrorCode(String name, String message, [String correction]) 9950 const ParserErrorCode(String name, String message, [String correction])
9959 : super(name, message, correction); 9951 : super(name, message, correction);
9960 9952
9961 @override 9953 @override
9962 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; 9954 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
9963 9955
9964 @override 9956 @override
9965 ErrorType get type => ErrorType.SYNTACTIC_ERROR; 9957 ErrorType get type => ErrorType.SYNTACTIC_ERROR;
9966 } 9958 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698