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

Issue 2709843004: Support for modifiers. (Closed)

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

Description

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -146 lines) Patch
M pkg/analyzer/test/generated/parser_fasta_test.dart View 7 chunks +0 lines, -112 lines 0 comments Download
M pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart View 10 chunks +51 lines, -34 lines 7 comments Download

Messages

Total messages: 8 (1 generated)
scheglov
3 years, 10 months ago (2017-02-21 22:25:28 UTC) #1
Paul Berry
lgtm assuming you take my suggestions below. https://codereview.chromium.org/2709843004/diff/1/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/2709843004/diff/1/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart#newcode1073 pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:1073: // TODO(scheglov): ...
3 years, 10 months ago (2017-02-21 23:09:11 UTC) #2
scheglov
https://codereview.chromium.org/2709843004/diff/1/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/2709843004/diff/1/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart#newcode1073 pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:1073: // TODO(scheglov): Report error. On 2017/02/21 23:09:11, Paul Berry ...
3 years, 10 months ago (2017-02-22 03:08:24 UTC) #3
scheglov
Committed patchset #1 (id:1) manually as c59a7413f7f2dfdad4755f13dbd706efb0560c3d (presubmit successful).
3 years, 10 months ago (2017-02-22 03:08:37 UTC) #5
ahe
lgtm https://codereview.chromium.org/2709843004/diff/1/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/2709843004/diff/1/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart#newcode1073 pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:1073: // TODO(scheglov): Report error. On 2017/02/21 23:09:11, Paul ...
3 years, 10 months ago (2017-02-22 09:08:17 UTC) #6
scheglov
https://codereview.chromium.org/2709843004/diff/1/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/2709843004/diff/1/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart#newcode1073 pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:1073: // TODO(scheglov): Report error. On 2017/02/22 09:08:17, ahe wrote: ...
3 years, 10 months ago (2017-02-22 16:32:46 UTC) #7
ahe
3 years, 9 months ago (2017-02-27 08:39:26 UTC) #8
Message was sent while issue was closed.
FYI

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

https://codereview.chromium.org/2709843004/diff/1/pkg/front_end/lib/src/fasta...
pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart:1073: // TODO(scheglov):
Report error.
On 2017/02/22 16:32:46, scheglov wrote:
> There are 331 usage of internalError() and just 2 usages of printUnexpected()
in
> the codebase. So, it seems that internalError() is more popular.

We talked about the differences between internalError and printUnexpected in a
meeting, but as my memory sometimes plays tricks on me, I've realized that
there's an even better way to report compile-time errors.

internalError is used when the compiler is broken. Here's its documentation:

/// Used to report an internal error.
///
/// Internal errors should be avoided as best as possible, but are preferred
/// over assertion failures. Favor error messages that starts with "Internal
/// error: " and a short description that may help a developer debug the issue.
/// This method should be called instead of using `throw`, as this allows us to
/// ensure that there are no throws anywhere in the codebase.

So that might not be the right thing to use here as it seems you've identified a
compile-time error.

I haven't documented [printUnexpected], and I'll do so, but I've documented
[inputError] which is kinda similar. The latter stops the compilation, that is,
a fatal compile-time error that the compiler can't recover from. Obviously, this
isn't ideal, so I added [printUnexpected], which just prints a compile-time
error.

However, when you're in BodyBuilder or AstBuilder, you always have access to the
current library builder, so you can use LibraryBuilder.addCompileTimeError.

So finally, I can conclude that LibraryBuilder.addCompileTimeError would
probably be the right method to use here :-)

I'll create a CL where I update the documentation.

Powered by Google App Engine
This is Rietveld 408576698