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

Issue 2486873003: Move scanner into pkg/front_end/lib/src/scanner. (Closed)

Created:
4 years, 1 month ago by Paul Berry
Modified:
4 years, 1 month ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Move scanner into pkg/front_end/lib/src/scanner. Several support classes also had to move to front_end along with the scanner. Some of these support classes arguably don't belong to the scanner itself, since they have other uses (e.g. SyntacticEntity, ErrorCode, ErrorSeverity, ErrorType, and StringUtilities). They will be reorganized into a more appropriate location in future CLs, at the time that they become needed by other components of the front end. In order to avoid dragging in a lot of dependencies, the following changes were made: 1. Scanner no longer reports errors through Source and AnalysisErrorListener objects passed to the constructor. Instead, it provides an abstract reportError() method which clients may override to perform error reporting in any way they wish. Analyzer contains an override of Scanner that mimics the old behavior in order to maintain compatibility. 2. Static members of ErrorCode (`values` and `byUniqueName`) have been moved to top level, and remain in analyzer. To maintain compatibility, these static members remain in ErrorCode (as deprecated members that simply wrap the implementations in analyzer). This means we have a reverse dependency (front_end depends on analyzer), but this dependency will go away as soon as we publish the next breaking change release of analyzer. R=brianwilkerson@google.com, scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/0a1fb8d248b1a2ca4cfe145a204ce4c7c3ef0206

Patch Set 1 #

Total comments: 23
Unified diffs Side-by-side diffs Delta from patch set Stats (+1681 lines, -3712 lines) Patch
M pkg/analyzer/lib/dart/ast/syntactic_entity.dart View 1 chunk +2 lines, -22 lines 0 comments Download
M pkg/analyzer/lib/dart/ast/token.dart View 1 chunk +2 lines, -734 lines 0 comments Download
M pkg/analyzer/lib/error/error.dart View 3 chunks +617 lines, -900 lines 4 comments Download
M pkg/analyzer/lib/src/dart/analysis/driver.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/analyzer/lib/src/dart/ast/token.dart View 2 chunks +15 lines, -553 lines 0 comments Download
M pkg/analyzer/lib/src/dart/error/syntactic_errors.dart View 2 chunks +2 lines, -54 lines 0 comments Download
M pkg/analyzer/lib/src/dart/scanner/reader.dart View 2 chunks +4 lines, -41 lines 0 comments Download
M pkg/analyzer/lib/src/dart/scanner/scanner.dart View 2 chunks +11 lines, -1312 lines 0 comments Download
M pkg/analyzer/lib/src/generated/interner.dart View 2 chunks +4 lines, -20 lines 0 comments Download
M pkg/analyzer/lib/src/task/options.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/analyzer/pubspec.yaml View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/analyzer/test/generated/inheritance_manager_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/analyzer/test/generated/non_hint_code_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/analyzer/test/generated/parser_test.dart View 6 chunks +6 lines, -6 lines 0 comments Download
M pkg/analyzer/test/generated/resolver_test_case.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/analyzer/test/generated/test_support.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/analyzer/test/src/dart/constant/evaluation_test.dart View 1 chunk +1 line, -1 line 0 comments Download
A pkg/front_end/lib/src/scanner/errors.dart View 1 chunk +361 lines, -0 lines 6 comments Download
A + pkg/front_end/lib/src/scanner/interner.dart View 2 chunks +2 lines, -25 lines 4 comments Download
A pkg/front_end/lib/src/scanner/reader.dart View 1 chunk +46 lines, -0 lines 2 comments Download
A + pkg/front_end/lib/src/scanner/scanner.dart View 5 chunks +18 lines, -30 lines 0 comments Download
A pkg/front_end/lib/src/scanner/string_utilities.dart View 1 chunk +28 lines, -0 lines 1 comment Download
A + pkg/front_end/lib/src/scanner/syntactic_entity.dart View 1 chunk +1 line, -1 line 2 comments Download
A + pkg/front_end/lib/src/scanner/token.dart View 4 chunks +554 lines, -7 lines 4 comments Download

Messages

Total messages: 13 (3 generated)
Paul Berry
4 years, 1 month ago (2016-11-08 19:34:40 UTC) #2
scheglov
LGTM
4 years, 1 month ago (2016-11-08 20:07:05 UTC) #3
Brian Wilkerson
I pointed this out in a couple of explicit comments, but then decided to provide ...
4 years, 1 month ago (2016-11-08 20:53:24 UTC) #4
Paul Berry
On 2016/11/08 20:53:24, Brian Wilkerson wrote: > I pointed this out in a couple of ...
4 years, 1 month ago (2016-11-08 21:46:55 UTC) #5
Paul Berry
https://codereview.chromium.org/2486873003/diff/1/pkg/analyzer/lib/error/error.dart File pkg/analyzer/lib/error/error.dart (right): https://codereview.chromium.org/2486873003/diff/1/pkg/analyzer/lib/error/error.dart#newcode33 pkg/analyzer/lib/error/error.dart:33: // lib/src/error/codes.dart | On 2016/11/08 20:53:23, Brian Wilkerson wrote: ...
4 years, 1 month ago (2016-11-08 21:47:06 UTC) #6
Paul Berry
Committed patchset #1 (id:1) manually as 0a1fb8d248b1a2ca4cfe145a204ce4c7c3ef0206 (presubmit successful).
4 years, 1 month ago (2016-11-08 21:47:21 UTC) #8
Brian Wilkerson
lgtm https://codereview.chromium.org/2486873003/diff/1/pkg/front_end/lib/src/scanner/interner.dart File pkg/front_end/lib/src/scanner/interner.dart (right): https://codereview.chromium.org/2486873003/diff/1/pkg/front_end/lib/src/scanner/interner.dart#newcode1 pkg/front_end/lib/src/scanner/interner.dart:1: // Copyright (c) 2016, the Dart project authors. ...
4 years, 1 month ago (2016-11-08 22:01:23 UTC) #9
Paul Berry
https://codereview.chromium.org/2486873003/diff/1/pkg/front_end/lib/src/scanner/interner.dart File pkg/front_end/lib/src/scanner/interner.dart (right): https://codereview.chromium.org/2486873003/diff/1/pkg/front_end/lib/src/scanner/interner.dart#newcode1 pkg/front_end/lib/src/scanner/interner.dart:1: // Copyright (c) 2016, the Dart project authors. Please ...
4 years, 1 month ago (2016-11-08 22:06:03 UTC) #10
kevmoo
DBQ https://codereview.chromium.org/2486873003/diff/1/pkg/front_end/lib/src/scanner/errors.dart File pkg/front_end/lib/src/scanner/errors.dart (right): https://codereview.chromium.org/2486873003/diff/1/pkg/front_end/lib/src/scanner/errors.dart#newcode7 pkg/front_end/lib/src/scanner/errors.dart:7: import 'package:analyzer/error/error.dart' We try to avoid circular dependencies ...
4 years, 1 month ago (2016-11-08 22:26:03 UTC) #12
Paul Berry
4 years, 1 month ago (2016-11-08 22:28:15 UTC) #13
Message was sent while issue was closed.
https://codereview.chromium.org/2486873003/diff/1/pkg/front_end/lib/src/scann...
File pkg/front_end/lib/src/scanner/errors.dart (right):

https://codereview.chromium.org/2486873003/diff/1/pkg/front_end/lib/src/scann...
pkg/front_end/lib/src/scanner/errors.dart:7: import
'package:analyzer/error/error.dart'
On 2016/11/08 22:26:03, kevmoo wrote:
> We try to avoid circular dependencies between packages (at least in the lib
> directory, tests are fine)
> 
> Is this short-term?

Yes.  This will be removed when the "@deprecated" members below are removed,
which we should be able to do next time we publish a breaking change to
analyzer.

Powered by Google App Engine
This is Rietveld 408576698