Commit Graph

6018 Commits

Author SHA1 Message Date
Paul Berry e54e5924eb Adjust front_end analysis options to allow supermixins.
I am assuming that supermixin functionality will be available on all
platforms by the time this is needed.  See also commit
28b6a1f7ea.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2496363002 .
2016-11-14 11:21:44 -08:00
Paul Berry 4cd9b28eb6 Create pkg/front_end/src/base and begin populating with general use classes.
In the long run, pkg/front_end/src/base is intended to contain code
that is useful to many components of the front end.

In this initial implementation, it contains:
- Source and the classes it references
- ErrorCode, ErrorSeverity, and ErrorType
- SyntacticEntity

Note that AnalysisTarget is included (even though strictly speaking it
is part of the analyzer task model) because it was too hard to
disentangle from Source.

Note that Token classes remain in pkg/front_end/src/scanner for now; I
plan to reorganize them at the time the parser is moved into the front
end.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2486923007 .
2016-11-14 09:20:18 -08:00
Paul Berry 61ab47bcef Fix windows bot failure in physical_file_system_test.dart.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2498613002 .
2016-11-11 10:25:25 -08:00
Paul Berry 981e2660bf Remove deprecated members from ErrorCode.
These existed as an effort to avoid causing breaking changes in the
analyzer package, but it turns out that the analyzer package already has
breaking changes in progress, so there is no benefit.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2491593003 .
2016-11-09 18:11:42 -08:00
Paul Berry 7493d120a4 Remove front_end's dependency override on analyzer.
The override had no effect anyway, because it was identical to
front_end's dependency on analyzer.

This is necessary in order to publish front_end.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2487603004 .
2016-11-08 16:19:34 -08:00
Zachary Anderson 5f8580a673 Add BUILD.gn for pkg/front_end to fix the Fuchsia build
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2483353002 .
2016-11-08 15:15:07 -08:00
Paul Berry 0c3fade7f7 Fix front_end version number in preparation for publishing.
Analyzer needs to depend on a published version of front_end in order to
pass buildbot tests (it may be an alpha version).  This CL sets the
version to "0.1.0-alpha.0" (I will publish this version once the CL
lands).  Note that the previous version of front_end was "0.1.0", so we
appear to be moving the version backwards.  This is ok because version
"0.1.0" was never published.

Note that during this transitional period where code is being moved from
analyzer to front_end, we have circular imports between analyzer and
front_end, so from now until the transitional period ends, we will need
to publish front_end whenever we publish analyzer.

Update copyright notices in front_end package

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2485993003 .
2016-11-08 14:28:40 -08:00
Paul Berry e790b44c63 Update copyright notices in front_end package.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2483313003 .
2016-11-08 14:23:58 -08:00
Paul Berry 0a1fb8d248 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

Review URL: https://codereview.chromium.org/2486873003 .
2016-11-08 13:47:17 -08:00
Paul Berry 72fc9805d9 Add analysis options for front end, and fix a bug discovered by strong mode.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2489573002 .
2016-11-08 10:39:48 -08:00
Paul Berry 28b6a1f7ea Add implementations of the front end FileSystem API.
This required some small changes to the API contract.

Note that the tests use supermixins.  I'm assuming that supermixin
functionality will be available on all platforms by the time this is
needed.  If not, I will be happy to rewrite them.

R=scheglov@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/2471283002 .
2016-11-03 08:21:10 -07:00
Sigmund Cherem 2bcd189f2d add kernel generation to the front_end/tool/perf script
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2439053003 .
2016-10-21 09:10:19 -07:00
Sigmund Cherem 5964bdfa0b Copy perf.dart into front_end/tool.
This keeps analyzer_cli/perf.dart for now: I need to make the change in two
parts so I can update the benchmark runners after I submit this.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2432043008 .
2016-10-21 09:07:48 -07:00
Paul Berry 78ed4066c8 Add a "correction" field to front end compilation errors.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2429213008 .
2016-10-20 12:33:12 -07:00
Paul Berry d631a142a4 Create a README and pubspec for the front_end package.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2436733003 .
2016-10-19 12:14:38 -07:00
Paul Berry 8fca9ba968 First cut at a file system abstraction for the front end.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2426773004 .
2016-10-18 14:10:14 -07:00
Paul Berry 8c42e56964 Add "not intended to be implemented/extended" warnings to pkg/front_end.
This ensures that we may safely add methods to the classes in this
package without causing a breaking change.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2431733002 .
2016-10-18 13:31:40 -07:00
Paul Berry 0753607dea Initial API for the Dart front_end package.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2417043003 .
2016-10-17 12:36:08 -07:00