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

Issue 2767083002: fasta scanner recovery and error code translation improvements (Closed)

Created:
3 years, 9 months ago by danrubel
Modified:
3 years, 9 months ago
Reviewers:
ahe, Paul Berry
CC:
reviews_dartlang.org, dart-fe-team+reviews_google.com
Target Ref:
refs/heads/master
Visibility:
Public.

Description

fasta scanner recovery and error code translation improvements * cleanup defaultRecoveryStrategy next/previous and eof * add SymbolToken.eof() constructor to ensure that EOF tokens are correctly self referencing * add fasta.scanString method to match scan method * add fasta.ScannerResult.hasErrors field so that scan and scanString callers can quickly check for errors * new scanner replacement test which scans using fasta then asserts as if it were from analyzer * improve SymbolToken.toString() for EOF * update analyzer test :: fasta scanner considers "<" to be an opener * extract and move translateErrorToken into front_end * address comments in https://codereview.chromium.org/2763833002 R=ahe@google.com, paulberry@google.com Committed: https://github.com/dart-lang/sdk/commit/186c6f23bd2987b3a356946fa6706f38a52d7e40

Patch Set 1 #

Patch Set 2 : merge #

Total comments: 6

Patch Set 3 : revert address comments and fix for token_stream_rewriter test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+427 lines, -97 lines) Patch
M pkg/analyzer/lib/src/fasta/token_utils.dart View 7 chunks +5 lines, -77 lines 0 comments Download
M pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/front_end/lib/src/fasta/scanner.dart View 3 chunks +24 lines, -2 lines 0 comments Download
M pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/front_end/lib/src/fasta/scanner/array_based_scanner.dart View 1 chunk +1 line, -3 lines 0 comments Download
M pkg/front_end/lib/src/fasta/scanner/recover.dart View 3 chunks +14 lines, -2 lines 0 comments Download
M pkg/front_end/lib/src/fasta/scanner/token.dart View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M pkg/front_end/lib/src/scanner/errors.dart View 2 chunks +78 lines, -0 lines 0 comments Download
M pkg/front_end/test/fasta/parser/token_stream_rewriter_test.dart View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
A pkg/front_end/test/scanner_replacement_test.dart View 1 chunk +280 lines, -0 lines 0 comments Download
M pkg/front_end/test/scanner_test.dart View 1 chunk +9 lines, -5 lines 0 comments Download
M pkg/front_end/tool/fasta_perf.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 7 (2 generated)
danrubel
3 years, 9 months ago (2017-03-22 17:09:46 UTC) #2
ahe
lgtm Only nits below. https://codereview.chromium.org/2767083002/diff/20001/pkg/front_end/lib/src/fasta/scanner.dart File pkg/front_end/lib/src/fasta/scanner.dart (right): https://codereview.chromium.org/2767083002/diff/20001/pkg/front_end/lib/src/fasta/scanner.dart#newcode82 pkg/front_end/lib/src/fasta/scanner.dart:82: // does the Recover API ...
3 years, 9 months ago (2017-03-23 11:52:37 UTC) #3
Paul Berry
lgtm
3 years, 9 months ago (2017-03-23 16:20:23 UTC) #4
danrubel
Committed patchset #3 (id:40001) manually as 186c6f23bd2987b3a356946fa6706f38a52d7e40 (presubmit successful).
3 years, 9 months ago (2017-03-24 15:40:30 UTC) #6
danrubel
3 years, 9 months ago (2017-03-24 15:44:20 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/2767083002/diff/20001/pkg/front_end/lib/src/f...
File pkg/front_end/lib/src/fasta/scanner.dart (right):

https://codereview.chromium.org/2767083002/diff/20001/pkg/front_end/lib/src/f...
pkg/front_end/lib/src/fasta/scanner.dart:82: // does the Recover API need to be
adjusted for a String source?
On 2017/03/23 11:52:36, ahe wrote:
> Since we only need the bytes when performing error recovery, we could pass in
> the string source here and convert it to bytes if calling recover.

Done.

https://codereview.chromium.org/2767083002/diff/20001/pkg/front_end/lib/src/s...
File pkg/front_end/lib/src/scanner/errors.dart (right):

https://codereview.chromium.org/2767083002/diff/20001/pkg/front_end/lib/src/s...
pkg/front_end/lib/src/scanner/errors.dart:64: /**
On 2017/03/23 11:52:36, ahe wrote:
> Consistency: use either /// or /**

Good point. Changed /// to /** below to match the rest of the file.

https://codereview.chromium.org/2767083002/diff/20001/pkg/front_end/lib/src/s...
pkg/front_end/lib/src/scanner/errors.dart:67: * The [arguments] are any
arguments needed to complete the error message
On 2017/03/23 11:52:36, ahe wrote:
> Add a period to the end of this sentence.

Done.

Powered by Google App Engine
This is Rietveld 408576698