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

Issue 1789553003: Introduces `ParserOptions`. (Closed)

Created:
4 years, 9 months ago by eernst
Modified:
4 years, 8 months ago
CC:
reviews_dartlang.org, floitsch
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Introduces `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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+182 lines, -761 lines) Patch
M pkg/compiler/lib/compiler.dart View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M pkg/compiler/lib/compiler_new.dart View 1 2 3 chunks +2 lines, -506 lines 0 comments Download
M pkg/compiler/lib/src/apiimpl.dart View 1 2 3 2 chunks +3 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/common/resolution.dart View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/compiler.dart View 1 2 3 7 chunks +15 lines, -16 lines 0 comments Download
M pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart View 1 2 2 chunks +3 lines, -49 lines 0 comments Download
M pkg/compiler/lib/src/mirrors/analyze.dart View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
A + pkg/compiler/lib/src/options.dart View 1 2 3 13 chunks +108 lines, -143 lines 0 comments Download
M pkg/compiler/lib/src/parser/class_element_parser.dart View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/parser/diet_parser_task.dart View 1 2 1 chunk +7 lines, -9 lines 0 comments Download
M pkg/compiler/lib/src/parser/element_listener.dart View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/parser/parser.dart View 1 2 3 chunks +6 lines, -5 lines 0 comments Download
M pkg/compiler/lib/src/parser/parser_task.dart View 1 2 3 chunks +5 lines, -7 lines 0 comments Download
M pkg/compiler/lib/src/parser/partial_elements.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/parser/partial_parser.dart View 1 2 2 chunks +4 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/patch_parser.dart View 1 2 3 5 chunks +8 lines, -12 lines 0 comments Download

Messages

Total messages: 19 (3 generated)
eernst
`ParserOptions` related code from https://codereview.chromium.org/1723443003/ extracted and improved, ready for adding new options and providing ...
4 years, 9 months ago (2016-03-11 12:54:12 UTC) #2
Johnni Winther
lgtm https://codereview.chromium.org/1789553003/diff/1/pkg/compiler/lib/src/parser/parser.dart File pkg/compiler/lib/src/parser/parser.dart (right): https://codereview.chromium.org/1789553003/diff/1/pkg/compiler/lib/src/parser/parser.dart#newcode81 pkg/compiler/lib/src/parser/parser.dart:81: const ParserOptions({this.enableConditionalDirectives: false}); Nit: Add an empty line ...
4 years, 9 months ago (2016-03-11 13:43:39 UTC) #3
eernst
Hi Siggy, I'm adding you as a reviewer because this CL clashes with some work ...
4 years, 9 months ago (2016-03-21 13:03:35 UTC) #5
Siggi Cherem (dart-lang)
Hi Erik Thanks for bringing this up! I am totally in favor of projecting the ...
4 years, 9 months ago (2016-03-21 16:20:10 UTC) #6
eernst
On 2016/03/21 16:20:10, Siggi Cherem (dart-lang) wrote: > Hi Erik > > Thanks for bringing ...
4 years, 9 months ago (2016-03-22 10:40:24 UTC) #7
eernst
Forgot to mention this: A challenge in model (3) is that the code needed to ...
4 years, 9 months ago (2016-03-22 13:00:25 UTC) #8
eernst
On 2016/03/22 13:00:25, eernst wrote: > Forgot to mention this: > > A challenge in ...
4 years, 9 months ago (2016-03-22 14:11:59 UTC) #9
Siggi Cherem (dart-lang)
Good questions Erik! The case you found with canUseNative default to false happens to be ...
4 years, 9 months ago (2016-03-22 15:17:35 UTC) #10
eernst
On 2016/03/22 15:17:35, Siggi Cherem (dart-lang) wrote: > Good questions Erik! Thanks! ;-) I just ...
4 years, 9 months ago (2016-03-22 17:37:09 UTC) #11
Johnni Winther
LGTM
4 years, 9 months ago (2016-03-23 08:01:40 UTC) #12
eernst
Refactored substantially to have `CompilerOptions implements DiagnosticOptions, ParserOptions` in a new 'options.dart' library. `ScannerOptions` not ...
4 years, 9 months ago (2016-03-23 14:15:25 UTC) #13
eernst
On 2016/03/23 14:15:25, eernst wrote: > Refactored substantially to have `CompilerOptions implements DiagnosticOptions, > ParserOptions` ...
4 years, 8 months ago (2016-04-01 16:18:46 UTC) #14
Siggi Cherem (dart-lang)
LGTM! Thanks Erik, looks great! Sorry for the delay, this got buried in my inbox ...
4 years, 8 months ago (2016-04-01 16:34:01 UTC) #15
eernst
On 2016/04/01 16:34:01, Siggi Cherem (dart-lang) wrote: > LGTM! > > Thanks Erik, looks great! ...
4 years, 8 months ago (2016-04-04 12:44:42 UTC) #16
eernst
On 2016/04/01 16:34:01, Siggi Cherem (dart-lang) wrote: > LGTM! > > Thanks Erik, looks great! ...
4 years, 8 months ago (2016-04-04 12:44:45 UTC) #17
eernst
4 years, 8 months ago (2016-04-04 12:45:31 UTC) #19
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
d4c9a499d534f1a1c0147a1698a3b39ba0038d54 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698