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

Issue 2872433005: more work aligning fasta.Token with analyzer.Token (Closed)

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

Description

more work aligning fasta.Token with analyzer.Token * move isPseudo getter out of Token into TokenType * move special case charCount logic out of fasta.Token into fasta.ErrorToken * move more accessors from fasta.Token into analyzer.Token * add @overrides to denote which methods have been declared in analyzer.Token * make fasta LazySubstring and its subclasses private * rename fasta.previousToken to previous to match analyzer.Token * flatten fasta.Token.preceedingCommentTokens into preceedingComments * normalize fasta.Token.next and analyzer.Token.next R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/81d25f4c71e44e08fa94ea1616e7b5d97af20987

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -156 lines) Patch
M pkg/analyzer/lib/src/fasta/ast_builder.dart View 5 chunks +5 lines, -4 lines 0 comments Download
M pkg/analyzer/lib/src/fasta/token_utils.dart View 6 chunks +11 lines, -10 lines 0 comments Download
M pkg/analyzer/tool/summary/mini_ast.dart View 4 chunks +4 lines, -3 lines 0 comments Download
M pkg/front_end/lib/src/fasta/parser/parser.dart View 1 chunk +1 line, -1 line 2 comments Download
M pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart View 3 chunks +6 lines, -6 lines 0 comments Download
M pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M pkg/front_end/lib/src/fasta/scanner/error_token.dart View 1 chunk +5 lines, -0 lines 0 comments Download
M pkg/front_end/lib/src/fasta/scanner/recover.dart View 2 chunks +5 lines, -6 lines 0 comments Download
M pkg/front_end/lib/src/fasta/scanner/token.dart View 14 chunks +30 lines, -89 lines 0 comments Download
M pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart View 2 chunks +2 lines, -1 line 0 comments Download
M pkg/front_end/lib/src/scanner/token.dart View 11 chunks +33 lines, -13 lines 0 comments Download
M pkg/front_end/test/fasta/parser/token_stream_rewriter_test.dart View 6 chunks +12 lines, -12 lines 0 comments Download
M pkg/front_end/test/scanner_fasta_test.dart View 5 chunks +6 lines, -6 lines 0 comments Download
M pkg/front_end/test/scanner_replacement_test.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M pkg/front_end/test/subpackage_relationships_test.dart View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
danrubel
3 years, 7 months ago (2017-05-09 01:21:14 UTC) #2
scheglov
LGTM
3 years, 7 months ago (2017-05-09 02:14:40 UTC) #3
danrubel
Committed patchset #1 (id:1) manually as 81d25f4c71e44e08fa94ea1616e7b5d97af20987 (presubmit successful).
3 years, 7 months ago (2017-05-09 04:10:04 UTC) #5
ahe
https://codereview.chromium.org/2872433005/diff/1/pkg/front_end/lib/src/fasta/parser/parser.dart File pkg/front_end/lib/src/fasta/parser/parser.dart (right): https://codereview.chromium.org/2872433005/diff/1/pkg/front_end/lib/src/fasta/parser/parser.dart#newcode1054 pkg/front_end/lib/src/fasta/parser/parser.dart:1054: } else if (!inPlainSync && token.type.isPseudo) { Why this ...
3 years, 7 months ago (2017-05-15 09:23:12 UTC) #6
danrubel
3 years, 7 months ago (2017-05-15 13:03:18 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/2872433005/diff/1/pkg/front_end/lib/src/fasta...
File pkg/front_end/lib/src/fasta/parser/parser.dart (right):

https://codereview.chromium.org/2872433005/diff/1/pkg/front_end/lib/src/fasta...
pkg/front_end/lib/src/fasta/parser/parser.dart:1054: } else if (!inPlainSync &&
token.type.isPseudo) {
On 2017/05/15 09:23:12, ahe wrote:
> Why this change?

There was no corresponding `isPseudo` accessor in analyzer.Token and that
accessor always forwards to the type. Rather than add yet another accessor to
Token, I simply call `token.type.isPseudo`.  There are two other accessors in
analyzer.Token that do the same that I'd also like to remove, but I'll leave
that for another day.

All that said, if its important to have an `isPseudo` accessor on analyzer.Token
for performance or other reasons, then please let me know and I can add it and
refactor this call site to use it.

Powered by Google App Engine
This is Rietveld 408576698