Commit Graph

6018 Commits

Author SHA1 Message Date
Konstantin Shcheglov 48b22b0e52 Throw FileSystemException from FileSystemEntity methods.
We need to be able to handle exceptions regardless of the implementation.

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

Review-Url: https://codereview.chromium.org/2864183002 .
2017-05-08 08:27:54 -07:00
Dan Rubel e0e892008a remove TokenType.KEYWORD
Breaking change to be landed after all existing callsites
have been converted to use the new API.

This is part 2 of https://codereview.chromium.org/2842643004/

* make Keyword extend TokenType
* make TokenType.AS be the same object as Keyword.AS
* make TokenType.IS be the same object as Keyword.IS
* remove TokenType.KEYWORD
* remove unnecessary Keyword.info method

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2848493003 .
2017-05-08 11:20:21 -04:00
Peter von der Ahé 0dba8c9516 Update handling of multiline strings to specification.
R=johnniwinther@google.com, lrn@google.com

Review-Url: https://codereview.chromium.org/2847793002 .
2017-05-08 12:20:02 +02:00
Konstantin Shcheglov 02c1a3bc54 [TBR] Restore try/catch for FileSystemException in TranslateUri.
I need to add exceptions to FileSystem and switch everything to FS.

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

Review-Url: https://codereview.chromium.org/2864913002 .
2017-05-06 19:55:29 -07:00
Konstantin Shcheglov cc91d04514 Use FileSystem to read files in SourceLoader and TranslateUri.
This is a prerequisite for writing fast unit tests, as I would like
to do while working on the incremental kernel driver.

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

Review-Url: https://codereview.chromium.org/2865843002 .
2017-05-06 13:09:28 -07:00
P.Y. Laligand 21e9c40b8f Disable analysis on a few packages. (#29571) 2017-05-05 22:06:00 -07:00
Paul Berry 4e481ccee5 Separate updateComments from updateExpectations.
Previous to this CL, the updateExpectations flag had two effects:

- It caused ".expect" files to be updated.

- It caused embedded expectations comments in ".dart" files (of the
  form "/*@key=value*/") to be updated.

I'm finding that I frequently want to update the former but not the
latter, so I'm splitting this into two separate flags.

With this CL, updateExpectations only updates ".expect" files, and
updateComments only updates embedded expectations comments.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2863773004 .
2017-05-05 12:04:53 -07:00
Paul Berry 893a08c8dc Implement type inference of constructor invocations in Fasta.
Fixes 68 inference tests.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2865623003 .
2017-05-05 11:58:56 -07:00
Paul Berry 350e93b1a8 Fix handling of null/bottom in front_end type inference.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2863603004 .
2017-05-05 07:02:17 -07:00
Paul Berry de32b9a32a Hook up full list literal type inference logic.
AFAIK this is the full algorithm for list literal inference.  But some
list literal tests still don't pass.  I will investigate and fix in
future CLs.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2863733003 .
2017-05-05 04:23:39 -07:00
Paul Berry a59bff3423 Implement inferGenericFunctionOrType in front_end.
R=jmesserly@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2863833002 .
2017-05-04 18:21:53 -07:00
Paul Berry 28f277a7e2 Implement inferTypeFromConstraints in front_end.
This is an intermediate algorithm used in type inference.  It
corresponds to the method _GenericInferrer.infer() in analyzer.

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

Note: error reporting will be added in a follow-up CL.
Review-Url: https://codereview.chromium.org/2863823002 .
2017-05-04 16:32:32 -07:00
Paul Berry c376a45f91 Implement instantiateToBounds in front_end.
R=scheglov@google.com

Note: error reporting will be added in a follow-up CL.
Review-Url: https://codereview.chromium.org/2866543002 .
2017-05-04 15:23:20 -07:00
Paul Berry 3c04fa0007 Get astBuilder and typeInferenceEngine from SourceLoader.
This avoids some unnecessary plumbing.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2850683004 .
2017-05-04 13:46:10 -07:00
Konstantin Shcheglov a3db98c5de Infer VariableSet types.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2855323004 .
2017-05-04 13:37:02 -07:00
Konstantin Shcheglov 888097781b Create KernelVariableDeclaration for formal parameters.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2860173002 .
2017-05-04 13:32:35 -07:00
Konstantin Shcheglov f7c8c7e3ef Infer AsExpression types.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2862043002 .
2017-05-04 13:27:47 -07:00
Paul Berry 3bfa3a21f7 Minor tweaks to type_constraint_gatherer.dart.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2862063002 .
2017-05-04 13:22:49 -07:00
Sigmund Cherem 938d1ba524 Implement the kernel_generator API using fasta
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2856223003 .
2017-05-04 12:02:05 -07:00
Kevin Millikin 04f7ba272a Remove the Kernel setup_builtin_library transformation
This transformation replaces the body of _getMainClosure in
dart:_builtin with `return main` for the script's main if there is one
and removes the body if there is no main.

Without this transformation fasta will compile `return null` and dartk
will compile `return throw new NoSuchMethodError...`.  Both of these
patterns will be patched in the VM when dart:_builtin is compiled from
Kernel.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2861023002 .
2017-05-04 20:29:44 +02:00
Leaf Petersen 006c22d0a2 Re-remove ad hoc Future.then inference.
Ad hoc inference for Future.then (and overrides) was kept in place for
an extra release cycle to allow code that implemented the Future
interface to work both before and after the transition to using
FutureOr for the callback return type.  This CL removes support for
this ad hoc inference.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2859703004 .
2017-05-04 10:45:21 -07:00
Devon Carew f6f845c879 Fix a completion exception during import suggestions.
BUG=
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2862793002 .
2017-05-04 09:24:18 -07:00
Konstantin Shcheglov fe21d9fa62 Inference for typed ListLiteral(s).
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2856363002 .
2017-05-04 08:56:27 -07:00
Konstantin Shcheglov 9a34ac9f27 Type inference for StringConcatenation.
The test simple_literal_string was replaced with string_literal.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2855403002 .
2017-05-04 08:47:12 -07:00
Paul Berry 932a749bbc Begin implementing subtype matching for type inference.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2856383003 .
2017-05-04 08:40:45 -07:00
Devon Carew af7f15e633 package:kernel version change 0.3.0-dev.1 => 0.3.0-alpha.1.
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2857273002 .
2017-05-03 18:06:50 -07:00
Devon Carew 99d21dd9d0 Prepare package:analyzer 0.30.0.
BUG=
R=kevmoo@google.com

Review-Url: https://codereview.chromium.org/2862713002 .
2017-05-03 14:34:55 -07:00
Konstantin Shcheglov b567aeaeef Change Accessor(s) to use AstFactory to create MethodInvocation, PropertyGet/Set.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2857133004 .
2017-05-03 14:10:54 -07:00
Paul Berry 45d06d718c Fix prepareTopLevel's initialization of classHierarchy.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2854333003 .
2017-05-03 10:50:44 -07:00
Paul Berry d842f35bb2 Add a strong mode implementation of LUB to fasta; use it to infer ?:
R=ahe@google.com, leafp@google.com

Review-Url: https://codereview.chromium.org/2849213002 .
2017-05-03 10:36:47 -07:00
Konstantin Shcheglov ec4c247efb Add KernelXyzExpression stubs and factory methods.
Some of the factories methods don't accept yet enough tokens, and fileOffset(s) for them are set externally.

Also PropertyGet, SuperPropertySet, MethodInvocation which are used in accessors, are not converted yet.

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

Review-Url: https://codereview.chromium.org/2861523003 .
2017-05-03 08:50:42 -07:00
Konstantin Shcheglov 3820e630ca Create NullLiteral using AstFactory in BodyBuilder.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2856893002 .
2017-05-03 08:38:19 -07:00
Konstantin Shcheglov 6885aea0db Infer types of bool/null/string literals.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2849293002 .
2017-05-01 19:33:31 -07:00
Sigmund Cherem de36d11817 Add support for building patched_sdk and platform.dill for dart2js:
- defines a .gn target for patched_dart2js_sdk
 - changes patch_sdk.dart to handle a dart2js target
 - adds support in fasta to understand the `native` clause still used by dart2js
 - add option to fasta to know whether it is generating kernel for the vm or dart2js

I'm not excited about how I added the target distinction in fasta, the reason I
did so is that it affects the behavior in several ways: in how we handle
`native`, in the libraries that are included by default in the platform.dill file,
and in the transformations that need to be done.  I'm happy to change the
approach.

BUG=
R=ahe@google.com, vegorov@google.com, zra@google.com

Committed: https://github.com/dart-lang/sdk/commit/714523b103598d49295fa06b4ad13c6917c50399
Review-Url: https://codereview.chromium.org/2832353002 .
2017-05-01 17:23:02 -07:00
Konstantin Shcheglov 3604e69951 Infer types of double literals.
I'm also adding simple_* tests for integer and double literals, because
as it is now, existing tests are more complex, and we don't see whether
these basic features work.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2853113002 .
2017-05-01 14:16:25 -07:00
Konstantin Shcheglov e0ac0ad0f6 List all failing tests in compile/outline.status files.
When I marked them as passing in the other CL, they were still passing
even though I had not generated corresponding expectation files.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2856713002 .
2017-05-01 14:07:13 -07:00
Konstantin Shcheglov 37092ed677 New tests and improvements for generics in comments parsing.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2856463004 .
2017-05-01 12:52:09 -07:00
Sigmund Cherem e9cd0b0fa5 Revert "Add support for building patched_sdk and platform.dill for dart2js:"
This reverts commit 714523b103.

TBR=ahe@google.com,vegorov@google.com

Review-Url: https://codereview.chromium.org/2849183002 .
2017-05-01 10:29:26 -07:00
Sigmund Cherem 714523b103 Add support for building patched_sdk and platform.dill for dart2js:
- defines a .gn target for patched_dart2js_sdk
 - changes patch_sdk.dart to handle a dart2js target
 - adds support in fasta to understand the `native` clause still used by dart2js
 - add option to fasta to know whether it is generating kernel for the vm or dart2js

I'm not excited about how I added the target distinction in fasta, the reason I
did so is that it affects the behavior in several ways: in how we handle
`native`, in the libraries that are included by default in the platform.dill file,
and in the transformations that need to be done.  I'm happy to change the
approach.

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

Review-Url: https://codereview.chromium.org/2832353002 .
2017-05-01 10:11:42 -07:00
Erik Corry aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02:00
Sigmund Cherem f8fbff7322 Extend file-system abstraction with a couple methods, remove context.
New methods:
 - exists: I'll be using it for input validation among other things
 - lastModified: I'll be using this on some utilities to support the incremental
 API.

BUG=
R=paulberry@google.com

Committed: https://github.com/dart-lang/sdk/commit/99ab24f628b23f248582874a6987883ab76c3195
Committed: https://github.com/dart-lang/sdk/commit/102de9e476bcd2b17f35604a7a3e442b28e14194
Review-Url: https://codereview.chromium.org/2844903002 .
2017-04-28 15:57:06 -07:00
Konstantin Shcheglov f2f1c60904 Add 'scanGenericMethodComments' parameter to constructors and scan() functions.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850853004 .
2017-04-28 14:47:29 -07:00
Konstantin Shcheglov 911ed9ab94 Don't include parameter names in types, don't use Unicode arrow.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2848033002 .
2017-04-28 10:59:50 -07:00
Konstantin Shcheglov 2ef98b6e6e Synthetic function elements don't have a name or enclosing element/library.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2847213002 .
2017-04-28 10:35:00 -07:00
Konstantin Shcheglov f0e1add542 Set 'enclosingElement' for FunctionElementImpl_forLUB.
This makes almost all <unknown> library names to go away in front_end
inference tests.

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

Review-Url: https://codereview.chromium.org/2849893002 .
2017-04-28 09:30:07 -07:00
Asger Feldthaus ac40d0bb8e Add typedef AST node boilerplate.
This adds the Typedef and TypedefType to the kernel AST,
with the relevant boilerplate.

Typedefs are not implemented in frontend or backend.

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

Committed: https://github.com/dart-lang/sdk/commit/d1c3ee4b35227cb6926f03479a34f82774523773
Review-Url: https://codereview.chromium.org/2825053002 .
2017-04-28 13:26:47 +02:00
Dmitry Stefantsov 95f15308c8 Revert "Extend file-system abstraction with a couple methods, remove context."
This reverts commit 102de9e476.

TBR=sigmund@google.com

Review-Url: https://codereview.chromium.org/2850533004 .
2017-04-28 12:50:41 +02:00
Sigmund Cherem 102de9e476 Extend file-system abstraction with a couple methods, remove context.
New methods:
 - exists: I'll be using it for input validation among other things
 - lastModified: I'll be using this on some utilities to support the incremental
 API.

BUG=
R=paulberry@google.com

Committed: https://github.com/dart-lang/sdk/commit/99ab24f628b23f248582874a6987883ab76c3195
Review-Url: https://codereview.chromium.org/2844903002 .
2017-04-27 15:05:10 -07:00
Sigmund Cherem 6ce9d4e1fb Revert "Extend file-system abstraction with a couple methods, remove context."
This reverts commit 99ab24f628.

Tests failed under `--use-sdk`. Fix is simple, but the affected tests seem to
be failing because of another CL as well.

TBR=brianwilkerson@google.com,paulberry@google.com

Review-Url: https://codereview.chromium.org/2852463004 .
2017-04-27 14:46:40 -07:00
Dan Rubel dc19d42c54 change fasta.Token.isIdentifier() from method to getter
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2839403004 .
2017-04-27 17:38:54 -04:00