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 2689733003: Add the ability to convert an analyzer token stream to a Fasta one. (Closed)

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

Description

Add the ability to convert an analyzer token stream to a Fasta one. This will be needed in order to integrate Fasta into the existing analyzer codebase, because the analyzer task model considers the parser and scanner to be separate black boxes with an analyzer token stream in between. In order for Fasta to be able to drop into those black boxes, we will need to be able to convert Fasta tokens to analyzer tokens after scanning, and then back to Fasta tokens prior to parsing. Tested via a "round trip" test that converts the analyzer token stream into a Fasta token stream and then back. Note that the transformation is not perfect; it currently fails to recreate error tokens and it fails to hook up the connection between a BeginGroup token and the corresponding end token. But it is enough to be able to pass tests for now. It will be improved (and tests will be expanded) in future CLs. R=ahe@google.com Committed: https://github.com/dart-lang/sdk/commit/f0e657015dd72ec0ea97080b8490cda075053743

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+314 lines, -0 lines) Patch
M pkg/front_end/lib/src/fasta/analyzer/token_utils.dart View 2 chunks +209 lines, -0 lines 2 comments Download
A pkg/front_end/test/scanner_roundtrip_test.dart View 1 chunk +101 lines, -0 lines 0 comments Download
M pkg/front_end/test/scanner_test.dart View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
Paul Berry
3 years, 10 months ago (2017-02-11 13:43:28 UTC) #2
ahe
lgtm https://codereview.chromium.org/2689733003/diff/1/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart File pkg/front_end/lib/src/fasta/analyzer/token_utils.dart (right): https://codereview.chromium.org/2689733003/diff/1/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart#newcode159 pkg/front_end/lib/src/fasta/analyzer/token_utils.dart:159: return internalError('Unrecognized keyword: ${token.lexeme}'); For consistency: "Unrecognized keyword: ...
3 years, 10 months ago (2017-02-12 10:07:35 UTC) #3
Paul Berry
https://codereview.chromium.org/2689733003/diff/1/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart File pkg/front_end/lib/src/fasta/analyzer/token_utils.dart (right): https://codereview.chromium.org/2689733003/diff/1/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart#newcode159 pkg/front_end/lib/src/fasta/analyzer/token_utils.dart:159: return internalError('Unrecognized keyword: ${token.lexeme}'); On 2017/02/12 10:07:35, ahe wrote: ...
3 years, 10 months ago (2017-02-13 17:44:33 UTC) #4
Paul Berry
3 years, 10 months ago (2017-02-13 18:24:54 UTC) #6
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
f0e657015dd72ec0ea97080b8490cda075053743 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698