DescriptionIntroduces `ParserOptions`.
In preparation for support for generic methods (with an associated
command line option), this CL introduces a `ParserOptions` class and
uses that to pass the existing option `enableConditionalDirectives` to
all parsers. With that, the addition of an `enableGenericMethodSyntax`
option will be concise and well localized.
It is necessary to keep a `ParserOptions` object in `Parsing`, because
that's the only convenient channel for providing the options to the new
`Parser` and `ClassElementParser` created from the top-level function
`parse` in 'partial_elements.dart', and a from
`PartialClassElement.parseNode`, respectively.
The `ParserOptions` class is located in 'parser.dart'; from the current
import structure the most natural choice might be to put it in
'element_listener.dart', but considering the nature of that file it
seems less natural: What does `ParserOptions` have to do with element
listeners? So I put it in 'parser.dart', even though this causes a few
additional import statements.
R=johnniwinther@google.com, sigmund@google.com
Committed: https://github.com/dart-lang/sdk/commit/d4c9a499d534f1a1c0147a1698a3b39ba0038d54
Patch Set 1 #
Total comments: 2
Patch Set 2 : Refactoring for uniform approach to `XOptions` #Patch Set 3 : Refactor to use `CompilerOptions implements ..` #Patch Set 4 : Rebased to current state of sdk #Messages
Total messages: 19 (3 generated)
|