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

Issue 2694433002: Stop testing scanner error lengths. (Closed)

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

Description

Stop testing scanner error lengths. The scanner has always reported all errors as having a length of 1; trying to test that each error has the expected length just creates confusion. R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/fbcce6192c72f38df59fef3c3346b7f5645e30ff

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -19 lines) Patch
M pkg/front_end/test/scanner_fasta_test.dart View 2 chunks +1 line, -9 lines 0 comments Download
M pkg/front_end/test/scanner_test.dart View 6 chunks +6 lines, -10 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
Paul Berry
3 years, 10 months ago (2017-02-10 18:58:05 UTC) #2
scheglov
LGTM
3 years, 10 months ago (2017-02-10 19:00:05 UTC) #3
Paul Berry
Committed patchset #1 (id:1) manually as fbcce6192c72f38df59fef3c3346b7f5645e30ff (presubmit successful).
3 years, 10 months ago (2017-02-10 19:09:38 UTC) #5
Brian Wilkerson
I don't understand the reason for this change. All other errors need to have a ...
3 years, 10 months ago (2017-02-11 21:02:42 UTC) #6
Paul Berry
3 years, 10 months ago (2017-02-12 15:03:37 UTC) #7
Message was sent while issue was closed.
On 2017/02/11 21:02:42, Brian Wilkerson wrote:
> I don't understand the reason for this change. All other errors need to have a
> length associated with them, and I don't understand why we wouldn't have a
> length associated with scanner errors. I suspect that there are other changes
> (or factors) that I'm not aware of that make this make sense, but I don't see
> this as being a positive change.

I agree that it would make sense for a length to be associated with scanner
errors.  But the reality is that there isn't; even before this change, there was
no length associated with scanner errors, and the length was hardcoded to 1 in
pkg/analyzer/lib/src/dart/scanner/scanner.dart:52.  If you look at
https://github.com/dart-lang/sdk/commit/0a1fb8d248b1a2ca4cfe145a204ce4c7c3ef0206,
at the _reportError() function in
pkg/analyzer/lib/src/dart/scanner/scanner.dart, you can see that this was true
even prior to the scanner being moved into the front end.

So all this CL does is modify the scanner tests so that they don't test the
hardcoded 1.  I think that's appropriate, since the test is in front_end, and
the 1 is now hardcoded at the analyzer level rather than at the front_end level.

Long term, if we add a true length to scanner errors, I would have no problem
testing it in the front_end tests.  But considering that we've been getting by
without one for years, I think that's low priority to fix.

Powered by Google App Engine
This is Rietveld 408576698