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

Issue 2711813002: Add AstBuilder support for enum declarations. (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

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -26 lines) Patch
M pkg/analyzer/test/generated/parser_fasta_test.dart View 1 chunk +0 lines, -21 lines 0 comments Download
M pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart View 2 chunks +29 lines, -0 lines 3 comments Download
M pkg/front_end/lib/src/fasta/parser/listener.dart View 3 chunks +13 lines, -5 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
Paul Berry
3 years, 10 months ago (2017-02-22 21:56:08 UTC) #2
scheglov
LGTM
3 years, 10 months ago (2017-02-22 21:58:05 UTC) #3
Paul Berry
Committed patchset #1 (id:1) manually as 5e997051cf57261a8ece089b3c5ddc8b2384d97f (presubmit successful).
3 years, 10 months ago (2017-02-22 22:11:31 UTC) #5
ahe
3 years, 10 months ago (2017-02-23 16:47:25 UTC) #6
Message was sent while issue was closed.
lgtm

https://codereview.chromium.org/2711813002/diff/1/pkg/front_end/lib/src/fasta...
File pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart (right):

https://codereview.chromium.org/2711813002/diff/1/pkg/front_end/lib/src/fasta...
pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:126: // metadata, but the
spec doesn't permit it.
I think we should accept it for error recovery.

https://codereview.chromium.org/2711813002/diff/1/pkg/front_end/lib/src/fasta...
pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:1092: var openBrace =
enumKeyword.next.next as BeginGroupToken;
I would recommend against casts as they have to be checked at runtime. Instead,
this works well:

BeginGroupToken openBrace = enumKeyword.next.next;

https://codereview.chromium.org/2711813002/diff/1/pkg/front_end/lib/src/fasta...
pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:1094: // error recovery?
The scanner always provides a synthetic end token. The problem is actually on
the previous statement, if a { was missing. I don't think the parser can recover
from that today, though.

Powered by Google App Engine
This is Rietveld 408576698