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

Issue 2709623004: Add AstBuilder support for DottedName and ConditionalUri. (Closed)

Created:
3 years, 10 months ago by Paul Berry
Modified:
3 years, 10 months ago
Reviewers:
ahe, scheglov
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add AstBuilder support for DottedName and ConditionalUri. R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/d2309f3024f94a49bb10dcd09e1a1edd527565ac

Patch Set 1 #

Patch Set 2 : Reformat #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -30 lines) Patch
M pkg/analyzer/test/generated/parser_fasta_test.dart View 2 chunks +0 lines, -28 lines 0 comments Download
M pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart View 1 3 chunks +33 lines, -2 lines 4 comments Download
M pkg/front_end/lib/src/fasta/parser/listener.dart View 1 chunk +4 lines, -0 lines 2 comments Download

Messages

Total messages: 9 (2 generated)
Paul Berry
3 years, 10 months ago (2017-02-21 21:07:24 UTC) #2
scheglov
LGTM https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/fasta/parser/listener.dart File pkg/front_end/lib/src/fasta/parser/listener.dart (right): https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/fasta/parser/listener.dart#newcode335 pkg/front_end/lib/src/fasta/parser/listener.dart:335: /// - Condition (literal string; only present if ...
3 years, 10 months ago (2017-02-21 21:32:14 UTC) #3
Paul Berry
https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/fasta/parser/listener.dart File pkg/front_end/lib/src/fasta/parser/listener.dart (right): https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/fasta/parser/listener.dart#newcode335 pkg/front_end/lib/src/fasta/parser/listener.dart:335: /// - Condition (literal string; only present if [equalitySign ...
3 years, 10 months ago (2017-02-21 21:37:37 UTC) #4
Paul Berry
Committed patchset #2 (id:20001) manually as d2309f3024f94a49bb10dcd09e1a1edd527565ac (presubmit successful).
3 years, 10 months ago (2017-02-21 21:43:13 UTC) #6
ahe
lgtm https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart File pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart (right): https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart#newcode745 pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:745: // the listener. That would be ifKeyword.next.endGroup. https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart#newcode756 ...
3 years, 10 months ago (2017-02-22 05:58:53 UTC) #7
Paul Berry
https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart File pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart (right): https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart#newcode756 pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:756: Token leftParen = ifKeyword.next; On 2017/02/22 05:58:53, ahe wrote: ...
3 years, 10 months ago (2017-02-22 21:20:13 UTC) #8
ahe
3 years, 10 months ago (2017-02-23 17:51:52 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/f...
File pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart (right):

https://codereview.chromium.org/2709623004/diff/20001/pkg/front_end/lib/src/f...
pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:756: Token leftParen =
ifKeyword.next;
On 2017/02/22 21:20:13, Paul Berry wrote:
> On 2017/02/22 05:58:53, ahe wrote:
> > The scanner should have set up the token stream so that there's a synthetic
> > endGroup token for the right parenthesis.
> > 
> > The next token of the endGroup will be an error token. The parser may not
> > recover from this situation.
> 
> I think you're answering the question "what if there is no ')' token due to an
> error in the file being parsed?"  My question is "what if there is no '('
> token?"

Yes. I answered "what if there's no close parenthesis".
 
> Currently, the parser calls expect() to consume the '(' token, and expect()
> calls reportUnrecoverableError(), which calls handleUnrecoverableError(),
which
> throws an exception.  So the question is moot for now.

Yes, it is moot for now.

However, handleUnrecoverableError may recover. Take a look at handleError in
pkg/compiler/lib/src/parser/element_listener.dart.

> But in the long run we're going to have to change things so that when the
parser
> is invoked by analyzer, the error can be recovered from, at which point we're
> going to have to decide what should happen here.  I don't know whether we'll
> wind up introducing a synthetic '(' token or doing something else.  We'll have
> to make sure completion does the right thing.

I have been thinking that one should start by introducing a synthetic version of
whatever is missing, however, it's more complicated than that.

> Leaving the code as is for now.

Yes. I'm just using your todos as an opportunity to provide some additional
details.

Powered by Google App Engine
This is Rietveld 408576698