Commit Graph

4770 Commits

Author SHA1 Message Date
Konstantin Shcheglov 3d0a94278e Parse FunctionExpressionInvocation with Fasta.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2728703002 .
2017-03-01 11:19:27 -08:00
Dmitry Stefantsov 9c340f9eb1 Revert last 4 commits by @lrn
Reverted commits:
* ef097edad6. ("Make Analyzer, VM and
  dart2js accept URI strings as part-of library identifier.")
* e8e1857814. ("Fix bad example of URI
  part-of to be bad, not good.")
* 58f7a92ede. ("Add changelog entry for
  allowing URI in part-of.")
* a4a7d98dce. ("Use FutureOr in
  Completer.complete.")

TBR=lrn@google.com

Review-Url: https://codereview.chromium.org/2724853002 .
2017-03-01 16:44:52 +01:00
Lasse R.H. Nielsen ef097edad6 Make Analyzer, VM and dart2js accept URI strings as part-of library identifier.
R=brianwilkerson@google.com, floitsch@google.com, hausner@google.com, johnniwinther@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2640853005 .
2017-03-01 12:15:11 +01:00
Peter von der Ahé bb72d5e8a0 Let parser handle factory modifiers.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2721623002 .
2017-03-01 11:38:01 +01:00
Paul Berry 8849a29406 Implement AstBuilder.handleOperatorName.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2723873002 .
2017-02-28 16:36:03 -08:00
Konstantin Shcheglov 36cec1faef Parse ParenthesizedExpression as Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2726693002 .
2017-02-28 15:08:23 -08:00
Paul Berry fb1bc6ad83 Add preliminary support for method declarations to AstBuilder.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2706293014 .
2017-02-28 15:05:31 -08:00
Konstantin Shcheglov 25fb3dabdb Parse ThisExpression with Fasta.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2719083007 .
2017-02-28 13:52:01 -08:00
Konstantin Shcheglov e260980624 Parse SuperExpression with Fasta.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2721973002 .
2017-02-28 13:48:57 -08:00
Peter von der Ahé 2e0e3b918f Always provide a field for context.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2723513002 .
2017-02-28 16:49:19 +01:00
Peter von der Ahé 86cad48993 Create Fasta bootstrap test.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2719863003 .
2017-02-28 15:49:03 +01:00
Jens Johansen 773e90869c [Fasta] Save parent in TypeDeclarationBuilder
I get errors with library parent not set for some tests
(e.g. service tests). This fixes that.

BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2726533002 .
2017-02-28 15:02:21 +01:00
Peter von der Ahé c2f7f52e42 Run dartfmt on pkg/front_end/lib.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2718113003 .
2017-02-28 05:52:41 +01:00
Konstantin Shcheglov 69063303ac Add support for field formal function typed formal parameters.
Plus a couple of new tests.

R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2720763003 .
2017-02-27 14:01:26 -08:00
Konstantin Shcheglov b86388e3ed Support for function typed formal parameters.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2715203003 .
2017-02-27 12:50:08 -08:00
Peter von der Ahé 9a84b63402 Revert "Record shebangs as comments."
This reverts commit c4045d4ce8.

Review-Url: https://codereview.chromium.org/2712383004 .
2017-02-27 16:34:36 +01:00
Peter von der Ahé c4045d4ce8 Record shebangs as comments.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2711453002 .
2017-02-27 15:32:39 +01:00
Peter von der Ahé 5ed2a5bc8b Compute correct parent and fileUri for top-level fields.
Fixes https://github.com/dart-lang/sdk/issues/28884.

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2722503003 .
2017-02-27 13:11:03 +01:00
Peter von der Ahé 34be60b663 Use the correct URI for diagnostics during outline construction.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2715223002 .
2017-02-27 13:07:54 +01:00
Peter von der Ahé 6684a7845c Configure watch list for pkg/front_end.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2723453002 .
2017-02-27 12:59:50 +01:00
Peter von der Ahé 632c4130fe Use printUnexpected and add location information.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2717673002 .
2017-02-27 09:28:04 +01:00
Konstantin Shcheglov 8532481a87 Support multiple optional parameters.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2712023003 .
2017-02-24 16:34:58 -08:00
Konstantin Shcheglov 8d4e252fd1 Support for the 'covariant' keyword for formal parameters.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2716043003 .
2017-02-24 12:50:17 -08:00
Martin Kustermann 72cd2a06f6 fasta: Cache source bytes to ensure we use the same bytes for outline and bodies, Gives also around 2.5%
Running fasta on dart2js sources shows no significant RSS memory
increase (within flakiness range).

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2709573005 .
2017-02-24 17:32:30 +01:00
Martin Kustermann a94bd17168 fasta: Use more efficient Uint16List/Uint32List for line offset information, use hints for length
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2709983002 .
2017-02-24 17:03:39 +01:00
Asger Feldthaus a2e55c953d Add LibraryIndex class for finding classes and members by name.
The new class becomes a superclass of CoreTypes, which now gets its
functionality from that class, but also exposes commonly used built-in
members as fields.

This replaces a couple of ad-hoc linear searches spread throughout
the code.

The canonical names are not a convenient interface for transformers, so
the idea is that they can use LibraryIndex to address their own runtime
libraries.

To avoid name clashes and still have a somewhat convenient interface,
getters and setters are prefixed by 'get:' and 'set:' in the lookup
table (and only in the lookup table), and top-level members can be
accessed using '::' as the class name. This is the same convention
used by the VM, although it is currently not required to be the same.

R=dmitryas@google.com, karlklose@google.com, kmillikin@google.com

Review-Url: https://codereview.chromium.org/2706243011 .
2017-02-24 14:49:12 +01:00
Peter von der Ahé f4c6699816 Store redirecting constructors.
Fixes https://github.com/dart-lang/sdk/issues/28859

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2707263009 .
2017-02-24 09:04:15 +01:00
Konstantin Shcheglov ddddb2c50d Revert "Add NormalFormalParameter.covariantKeyword setter and factory parameter."
This reverts commit 57b78f422e.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2710393002 .
2017-02-23 21:22:00 -08:00
Konstantin Shcheglov 57b78f422e Add NormalFormalParameter.covariantKeyword setter and factory parameter.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2714843002 .
2017-02-23 14:48:57 -08:00
Paul Berry 0c1facfd9b Split parser tests that exercise class members to their own class.
In future CLs I will get these tests to pass.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2713553011 .
2017-02-23 14:22:16 -08:00
Konstantin Shcheglov 4500bb0920 Parse optional and named parameters.
I'm not a big fan of the currentParameterKind stack, this information is
almost accessible from parseFormalParameter(), but we don't pass the type
to the listener.

R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2709783003 .
2017-02-23 09:55:15 -08:00
Konstantin Shcheglov 86c1ef03ee Add support for FieldFormalParameter.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2716433002 .
2017-02-23 09:42:43 -08:00
Vyacheslav Egorov 80c3247f99 Make patch_sdk step invoke fasta's compile_platform to generate patched_sdk/platform.dill.
This is where Kernel isolate expects to find it currently.

This is a preparation for flipping DFE_USE_FASTA to true.

R=ahe@google.com, kustermann@google.com

Review-Url: https://codereview.chromium.org/2710943006 .
2017-02-23 17:12:45 +01:00
Karl Klose 5c2187bdd1 Canonicalize mixin applications by their name
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2709943005 .
2017-02-23 15:50:20 +01:00
Florian Loitsch a26b21fd52 Fix build by adjusting status files and renaming test files.
Review-Url: https://codereview.chromium.org/2711033003 .
2017-02-23 14:13:55 +01:00
Asger Feldthaus 8bfc4b47c0 Implement canonical name scheme in kernel.
This adds a class CanonicalName that can represent a library, class,
or member.  All references now go through a Reference object, which is
linked to both the AST node and its CanonicalName, so either can be
created first.

dartk now accepts multiple input files:
- If multiple dart files are given, they are all compiled.
- If multiple binaries are given, they are linked together.
Mixed dart and binary input is not supported by dartk.

dartk now has a flag --include-sdk which includes the entire SDK in
the output.  This is so the SDK can be compiled alone and then linked.

Example of compiling separately and then linking:
  dartk foo.dart -o foo.dill
  dartk main.dart -o main.dill
  dartk --include-sdk -o sdk.dill
  dartk main.dill foo.dill sdk.dill --target=vm --link -o program.dill

dartk still has incredibly slow cold start due to the analyzer loading
the dart sdk, so this does not actually speed things up at the moment.

BUG=
R=ahe@google.com, kmillikin@google.com, kustermann@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2665723002 .
2017-02-23 14:12:10 +01:00
Florian Loitsch 979183decf Add support for the new function-type syntax.
Fixes #27967
BUG= http://dartbug.com/27967
R=ahe@google.com, johnniwinther@google.com, paulberry@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/85227ba8a60332a18ae92cb1b87bf15d52a909bd
Reverted: https://github.com/dart-lang/sdk/commit/f5fc210f4f79f7e6b7ccefc24e7565e810e9dc7d
Committed: https://github.com/dart-lang/sdk/commit/e4999a631093690febb2eb90cbdbe1f9d5183455
Reverted: https://github.com/dart-lang/sdk/commit/c64c35153905fc2bf8a74c02297220385cfcbc87
Committed: https://github.com/dart-lang/sdk/commit/c289af39c36d9a5f7130a3e69b7891052652a64e
Reverted: https://github.com/dart-lang/sdk/commit/c66479f40767744d0bdd027c004583d6e32fe50f
Review-Url: https://codereview.chromium.org/2567133002 .
2017-02-23 13:36:28 +01:00
Paul Berry abcc4d4ad2 Add AstBuilder support for TypeArguments.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2716483002 .
2017-02-22 15:50:26 -08:00
Paul Berry 5e997051cf Add AstBuilder support for enum declarations.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2711813002 .
2017-02-22 14:11:26 -08:00
Paul Berry 3fbeb5d064 Add contextual information about identifiers to the parser listener API.
R=ahe@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2711463005 .
2017-02-22 12:42:36 -08:00
Paul Berry cdda898b3c Minor fixes to AstBuilder.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2709753006 .
2017-02-22 10:53:52 -08:00
Florian Loitsch c66479f407 Revert "Add support for the new function-type syntax."
This reverts commit c289af39c3.

BUG=

Review-Url: https://codereview.chromium.org/2710973002 .
2017-02-22 17:19:35 +01:00
Florian Loitsch c289af39c3 Add support for the new function-type syntax.
Fixes #27967
BUG= http://dartbug.com/27967
R=ahe@google.com, johnniwinther@google.com, sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/85227ba8a60332a18ae92cb1b87bf15d52a909bd

Reverted: https://github.com/dart-lang/sdk/commit/f5fc210f4f79f7e6b7ccefc24e7565e810e9dc7d

Committed: https://github.com/dart-lang/sdk/commit/e4999a631093690febb2eb90cbdbe1f9d5183455

Reverted: https://github.com/dart-lang/sdk/commit/c64c35153905fc2bf8a74c02297220385cfcbc87
Review-Url: https://codereview.chromium.org/2567133002 .
2017-02-22 16:53:49 +01:00
Martin Kustermann 237959c9a6 fasta: Use List instead of List<Object> because analyzer code assigns it to List<Token>
Review-Url: https://codereview.chromium.org/2711753002 .
2017-02-22 16:01:12 +01:00
Martin Kustermann 974c148993 fasta: Cache relativizeUri(fileUri) on LibraryBuilder and ClassBuilder (or rather it's base class)
This we we don't (re)calculate the same thing for each [ProcedureBuilder] and [FieldBuilder].

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2708893002 .
2017-02-22 15:40:09 +01:00
Martin Kustermann fd6ebf7761 fasta: Use a slightly more efficient implementation for the [StackListener]s stack
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2707003002 .
2017-02-22 15:17:29 +01:00
Peter von der Ahé 585933825e Handle redirecting constructors to DillMemberBuilder.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2705263002 .
2017-02-22 12:29:39 +01:00
Peter von der Ahé 640aae9e52 Update compile_platform to not use dartk.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2710693002 .
2017-02-22 10:04:14 +01:00
Konstantin Shcheglov 9a3f8224a4 Pass 'classKeyword' to endClassDeclaratio() and endNamedMixinApplication().
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2705333002 .
2017-02-21 22:13:01 -08:00
Konstantin Shcheglov c59a7413f7 Support for modifiers.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2709843004 .
2017-02-21 19:08:30 -08:00