| OLD | NEW |
| 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 Loading... |
| 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 22 matching lines...) Expand all Loading... |
| 2210 return _tokenMatchesIdentifier(next); | 2204 return _tokenMatchesIdentifier(next); |
| 2211 } | 2205 } |
| 2212 | 2206 |
| 2213 /** | 2207 /** |
| 2214 * Set whether the parser is to parse the async support. | 2208 * Set whether the parser is to parse the async support. |
| 2215 */ | 2209 */ |
| 2216 void set parseAsync(bool parseAsync) { | 2210 void set parseAsync(bool parseAsync) { |
| 2217 this._parseAsync = parseAsync; | 2211 this._parseAsync = parseAsync; |
| 2218 } | 2212 } |
| 2219 | 2213 |
| 2214 @deprecated |
| 2215 bool get parseConditionalDirectives => true; |
| 2216 |
| 2217 @deprecated |
| 2218 void set parseConditionalDirectives(bool value) {} |
| 2219 |
| 2220 /** | 2220 /** |
| 2221 * Set whether parser is to parse function bodies. | 2221 * Set whether parser is to parse function bodies. |
| 2222 */ | 2222 */ |
| 2223 void set parseFunctionBodies(bool parseFunctionBodies) { | 2223 void set parseFunctionBodies(bool parseFunctionBodies) { |
| 2224 this._parseFunctionBodies = parseFunctionBodies; | 2224 this._parseFunctionBodies = parseFunctionBodies; |
| 2225 } | 2225 } |
| 2226 | 2226 |
| 2227 /** | 2227 /** |
| 2228 * Advance to the next token in the token stream, making it the new current | 2228 * Advance to the next token in the token stream, making it the new current |
| 2229 * token and return the token that was current before this method was invoked. | 2229 * token and return the token that was current before this method was invoked. |
| (...skipping 3123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5353 return new Configuration(ifKeyword, leftParenthesis, name, equalToken, | 5353 return new Configuration(ifKeyword, leftParenthesis, name, equalToken, |
| 5354 value, rightParenthesis, libraryUri); | 5354 value, rightParenthesis, libraryUri); |
| 5355 } | 5355 } |
| 5356 | 5356 |
| 5357 /** | 5357 /** |
| 5358 * Parse a list of configurations. If conditional directives are not | 5358 * Parse a list of configurations. If conditional directives are not |
| 5359 * supported, return an empty list without attempting to parse anything. | 5359 * supported, return an empty list without attempting to parse anything. |
| 5360 */ | 5360 */ |
| 5361 List<Configuration> _parseConfigurations() { | 5361 List<Configuration> _parseConfigurations() { |
| 5362 List<Configuration> configurations = <Configuration>[]; | 5362 List<Configuration> configurations = <Configuration>[]; |
| 5363 if (parseConditionalDirectives) { | 5363 while (_matchesKeyword(Keyword.IF)) { |
| 5364 while (_matchesKeyword(Keyword.IF)) { | 5364 configurations.add(_parseConfiguration()); |
| 5365 configurations.add(_parseConfiguration()); | |
| 5366 } | |
| 5367 } | 5365 } |
| 5368 return configurations; | 5366 return configurations; |
| 5369 } | 5367 } |
| 5370 | 5368 |
| 5371 /** | 5369 /** |
| 5372 * Parse a const expression. Return the const expression that was parsed. | 5370 * Parse a const expression. Return the const expression that was parsed. |
| 5373 * | 5371 * |
| 5374 * constExpression ::= | 5372 * constExpression ::= |
| 5375 * instanceCreationExpression | 5373 * instanceCreationExpression |
| 5376 * | listLiteral | 5374 * | listLiteral |
| (...skipping 4582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9959 */ | 9957 */ |
| 9960 const ParserErrorCode(String name, String message, [String correction]) | 9958 const ParserErrorCode(String name, String message, [String correction]) |
| 9961 : super(name, message, correction); | 9959 : super(name, message, correction); |
| 9962 | 9960 |
| 9963 @override | 9961 @override |
| 9964 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; | 9962 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; |
| 9965 | 9963 |
| 9966 @override | 9964 @override |
| 9967 ErrorType get type => ErrorType.SYNTACTIC_ERROR; | 9965 ErrorType get type => ErrorType.SYNTACTIC_ERROR; |
| 9968 } | 9966 } |
| OLD | NEW |