Commit Graph

2004 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
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
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
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
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
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
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
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
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 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
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
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
Konstantin Shcheglov 3a612c7b73 Generated front_end/testcases/inference test files from Analyzer tests.
Only *.strong.expect files are included.
The tests are marked as failing for compile/, kompile/ and outline/.
I could generate them, but I don't think that these results are
actually "expected", it'd more like the "status quo".

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

Review-Url: https://codereview.chromium.org/2846103002 .
2017-04-27 14:32:31 -07:00
Sigmund Cherem 99ab24f628 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

Review-Url: https://codereview.chromium.org/2844903002 .
2017-04-27 14:01:10 -07:00
Konstantin Shcheglov cf013c6469 Instrument analyzer's type analysis and run front_end inference tests.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2846463003 .
2017-04-26 13:31:10 -07:00
Paul Berry 324d60d764 Add type schema elimination logic.
As defined in https://github.com/dart-lang/sdk/pull/29371/files

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2837093002 .
2017-04-26 12:56:13 -07:00
Dan Rubel 3b790e5311 new TokenType and Keyword API
This adds two new methods and adapts most of the old references
to use these new API. Once all call sites have been updated,
the old API can be removed.

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

* replace type == TokenType.KEYWORD with type.isKeyword
* change Keyword.syntax --> Keyword.lexeme

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

Review-Url: https://codereview.chromium.org/2842213003 .
2017-04-26 15:53:58 -04:00
Sigmund Cherem 06189b271a loader, target, diet_listener moved
from front_end/lib/src/fasta/analyzer/
   to   analyzer/lib/src/fasta/

analyzer_compile and compile_platform_dartk moved
   from front_end/lib/src/fasta/analyzer/
   to   front_end/tool/_fasta/

front_end/src/fasta/testing/* continues to have some shared testing logic,
 - logic to compute the patched sdk is moved up one level
 - TestContext, Run, and suite.dart (which depend on analyzer) moved to pkg/front_end/test/fasta/testing/
 - only a copy of TestContext is duplicated under pkg/kernel/test/closure/.

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

Review-Url: https://codereview.chromium.org/2828583003 .
2017-04-25 13:16:14 -07:00
Paul Berry a3311858a7 Introduce initial plumbing for type promotion in fasta.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2829223007 .
2017-04-25 09:06:51 -07:00
Dan Rubel 684065855f merge PrecedenceInfo into TokenType and update all refs
* replace PrecedenceInfo *_INFO with TokenType.*
* remove outdated PrecedenceInfo tests
* delete unused precedence_info.dart

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2832403002 .
2017-04-25 08:51:52 -04:00
Paul Berry 3785385083 Make it possible to represent type schemas in the front end.
See https://github.com/dart-lang/sdk/pull/29371/files for more
information.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2839513002 .
2017-04-24 11:40:20 -07:00
Dan Rubel 54d131ebd9 merge fasta.PrecedenceInfo into analyzer.TokenType
* move precedence consts into analyzer token.dart
* move PrecedenceInfo.all to TokenType.all
* replace references to PrecedenceInfo with TokenType
* merge fasta.PrecedenceInfo into analyzer.TokenType

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

Review-Url: https://codereview.chromium.org/2837473002 .
2017-04-23 09:13:24 -04:00
Erik Corry 4b9bba55b4 Stoppp using trippple consonants
R=ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2833073002 .
2017-04-21 17:50:13 +02:00
Paul Berry 77d26a330c Add top level type inference logic for integer literals.
This CL hooks up enough infrastructure for doing simple top level type
inference of variables whose initializer is an int.

Additional type inference rules will be added in follow-up CLs.

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2828253003 .
2017-04-21 04:38:18 -07:00
Sigmund Cherem 4a19708532 Remove use of package:analyzer in dependency_grapher
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2834543002 .
2017-04-20 17:06:04 -07:00
Jacob Richman 997b4e62af Run formatter on a few frontend and kernel files that hadn't been formatted.
BUG=
R=asgerf@google.com

Review-Url: https://codereview.chromium.org/2820323005 .
2017-04-20 09:25:13 -07:00
Peter von der Ahé cf6b2736ec Wrap VariableDeclarations in Blocks as specified by Kernel.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2801283002 .
2017-04-20 09:31:36 +02:00
Paul Berry a682c6a97e Introduce a testing framework for use with fasta type inference.
The framework will allow test source files to be annotated with
comments indicating where types are expected to be inferred, for
example:

    var /*@type=dart.core::int*/ x = 1;

Other features of the testing framework:

- Normally only those expectations explicitly listed will be checked.
  The special comment "/*@testedFeatures=inference*/" at the top of
  the file turns on extra checking which will cause the test to fail
  if any unexpected type inference occurs.

- Should be easy to extend to support other features, such as checking
  that the proper errors and warnings are generated at the proper
  locations.

- If the test is run with "-DupdateExpectations=true", the
  expectations will be updated in place.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2824393002 .
2017-04-19 06:54:08 -07:00
Peter von der Ahé 2d9956a93d Move kernel baseline tests to front_end.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2825063002 .
2017-04-19 10:57:58 +02:00
Paul Berry 6d737cb684 Introduce initial plumbing for type inference in fasta.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2823243002 .
2017-04-18 09:37:54 -07:00
Peter von der Ahé 6b150cb01f Verify rethrow and parents of variables.
R=asgerf@google.com

Review-Url: https://codereview.chromium.org/2800853005 .
2017-04-07 12:59:03 +02:00
Dan Rubel 46b0c1da56 merge fasta.Keyword into analyzer.Keyword
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2797133008 .
2017-04-06 16:52:01 -04:00
Dan Rubel 4b8a2eb03b enhance analyzer to parse uppercase and built-in/pseudo keywords
Retrying https://codereview.chromium.org/2803563003

* update analyzer.Keyword list to include all of the fasta keywords

* enhance the analyzer scanner keyword table to handle uppercase
  keywords such as "Function"

* update analyzer's parser to process the new KeywordTokens

* fix analyzer error verification

* update translation of fasta <--> analyzer tokens

* update tests and cleanup analyzer warnings

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2799133003 .
2017-04-06 15:24:53 -04:00
danrubel e7f700ae66 Revert "enhance analyzer to parse uppercase and built-in/pseudo keywords"
This reverts commit 0c9e871b0f.

Review-Url: https://codereview.chromium.org/2797353002 .
2017-04-05 17:27:41 -04:00
Dan Rubel 0c9e871b0f enhance analyzer to parse uppercase and built-in/pseudo keywords
* update analyzer.Keyword list to include all of the fasta keywords

* enhance the analyzer scanner keyword table to handle uppercase
  keywords such as "Function"

* update analyzer's parser to process the new KeywordTokens

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2803563003 .
2017-04-05 16:37:30 -04:00
Dan Rubel a370462274 move fasta.Keyword methods to analyzer.Keyword
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2800583002 .
2017-04-05 13:51:53 -04:00
Peter von der Ahé 91abfa47d7 Update subpackage relationship.
Review-Url: https://codereview.chromium.org/2793223003 .
2017-04-04 15:15:28 +02:00
Peter von der Ahé fc1d179cae Sort procedures by source positions.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2789863002 .
2017-04-04 11:25:17 +02:00
Peter von der Ahé babf66241f Move scope.dart.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2794533002 .
2017-04-04 11:00:43 +02:00
Peter von der Ahé 4827ac4f38 Remove references to renamed test.
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2790893002 .
2017-04-04 09:51:29 +02:00