Commit Graph

6018 Commits

Author SHA1 Message Date
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
Paul Berry ed41766091 Simplify shadow class hierarchy.
Change the front_end's shadow class hierarchy so that instead of
containing implementation classes and mixin classes, it only contains
implementation classes.  The mixins proved to be unnecessary.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2819423004 .
2017-04-18 06:31:42 -07:00
Konstantin Shcheglov 07347d84fc Parse type substitution comments /*=T*/ in variable declarations with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2804753003 .
2017-04-07 12:59:02 -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
Peter von der Ahé 20aefd34f5 Document file names in deps files.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2805663002 .
2017-04-07 12:37:29 +02:00
Peter von der Ahé b8d63c3890 Use identical to compare strings.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2801963003 .
2017-04-07 12:35:34 +02:00
Peter von der Ahé 1e70fef1a2 Small steps towards deferred loading.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2803833003 .
2017-04-07 12:23:35 +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
Konstantin Shcheglov 1b0b94c6e6 Fix for parsing annotations before variables in for-loop with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2797303003 .
2017-04-06 10:59:53 -07:00
Peter von der Ahé af73802a67 Document the parser's design.
R=johnniwinther@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2799043004 .
2017-04-06 17:53:01 +02:00
Peter von der Ahé 32e2d2af84 Handle const list and map literals.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2802693004 .
2017-04-06 14:51:35 +02:00
Peter von der Ahé 7751bb7fe4 Missing file from CL 2804843003.
Review-Url: https://codereview.chromium.org/2804973002 .
2017-04-06 12:29:39 +02:00
Peter von der Ahé d515791312 Handle bad packages files and #void without crashing.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2804843003 .
2017-04-06 12:05:54 +02:00
Peter von der Ahé 0df001cebf Implement various getters on DillMember.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2799783004 .
2017-04-06 10:54:48 +02: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
Konstantin Shcheglov c9407b4544 Include ':' before constructor separators into AST with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2802753002 .
2017-04-05 13:25:46 -07: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é 0fcc4ee024 Implement parsing of metadata on local variables.
R=johnniwinther@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2798603003 .
2017-04-05 19:12:42 +02:00
Paul Berry 191be2df39 Make the AstFactory API refer to kernel types rather than "shadow" types.
This dramatically reduces the amount of type casting that has to
happen in the Fasta type inference prototype.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2802433003 .
2017-04-05 09:04:53 -07:00
Peter von der Ahé b06e4d5754 Create separate scopes for constructors, setters, and other members.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2788153002 .
2017-04-05 16:07:32 +02:00
Peter von der Ahé f07800446d Remove classMembers getter.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2792453003 .
2017-04-05 15:23:55 +02:00
Peter von der Ahé da115a0bca Add debugString to scope.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2795433002 .
2017-04-05 15:20:07 +02:00
Peter von der Ahé ddda182957 Add Source.getTextLine and use it to display source snippets in error messages.
R=asgerf@google.com, johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2788373002 .
2017-04-05 15:02:49 +02:00
Paul Berry 80101ac407 Re-duplicate frontend_accessors.dart.
This was de-duped in 02573b3caa, however
there's a problem: In order to share type inference and error
detection logic between Fasta's AstBuilder and BodyBuilder classes,
Fasta's use of the accessors needs to be rewritten to make use of the
shadow hierarchy (see
pkg/front_end/lib/src/fasta/builder/shadow_ast.dart), which kernel
shouldn't have to depend on.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2794013003 .
2017-04-04 10:48:50 -07:00
Konstantin Shcheglov 21982e562c Use SubStringScanner to scan generic comments.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2794833003 .
2017-04-04 08:45:41 -07:00
Peter von der Ahé 79b021be92 Change signature of resolveConstructors.
Review-Url: https://codereview.chromium.org/2795723003 .
2017-04-04 17:15:30 +02:00
Dan Rubel b5b64e98e9 fix fasta/analyzer KeywordToken.value()
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2795243002 .
2017-04-04 10:52:00 -04:00
Peter von der Ahé 368d1ec58a Add assertion on addImplementationBuilder.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2788923002 .
2017-04-04 15:43:37 +02: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é cb9930c097 Remove unused method.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2788143002 .
2017-04-04 14:58:12 +02:00
Dan Rubel 75a608b761 fasta tokens implement analyzer token API
* finish making fasta tokens implement analyzer token API

* move a couple things from analyzer into front_end
   * Scanner useFasta flag
   * SyntheticKeywordToken
   * SyntheticStringToken

* add a fastaSupportsGenericMethodComments flag to more easily find
  all of the places in the code that need to be addressed
  when this functionality is added or dropped

* initialize linestarts in scanner adapter
* cleanup analyzer hints

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2794653002 .
2017-04-04 08:55:44 -04:00
Peter von der Ahé 376c5e2d0b Store offsets in ModifierBuilders.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2786423002 .
2017-04-04 14:53:10 +02:00
Peter von der Ahé bfc4039d54 Special scope for labelled statements.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2790923002 .
2017-04-04 14:29:25 +02:00
Peter von der Ahé a0b58622d7 Handle unresolved identifiers with an accessor.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2790743004 .
2017-04-04 12:43:21 +02:00
Peter von der Ahé 5fcbc900a6 Prepare for separate setter scope.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2788913002 .
2017-04-04 12:20:16 +02:00
Peter von der Ahé 68ae077161 Make top-level scope implicit.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2785883005 .
2017-04-04 11:35:16 +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
Konstantin Shcheglov 35d96bacab Add support for parsing comments with generic parameters /*<K, V>*/ with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2795063002 .
2017-04-03 16:27:45 -07:00
Konstantin Shcheglov ef166a6481 Add CommentToken.parent and implement CommentToken.remove().
R=danrubel@google.com, ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2796723002 .
2017-04-03 14:27:26 -07:00
Konstantin Shcheglov ed1152fe8d Scan generic method comments with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2792053002 .
2017-04-03 12:01:54 -07:00
Brian Wilkerson dd49e79f74 Add context information to driver and add hooks for plugin management
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2795743002 .
2017-04-03 10:13:45 -07:00
Peter von der Ahé 5bdc1199ca Fix dart2js warnings and add test to ensure it stays clean.
Filed https://github.com/dart-lang/sdk/issues/29224 to track all the problems that require ignore.

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2791993002 .
2017-04-03 15:08:40 +02:00
Dan Rubel c22c6bad6c flag to enable fasta scanner in analyzer
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2784363002 .
2017-03-30 14:16:12 -04:00
Paul Berry 64623c095f Remove unnecessary import prefixes.
Due to the renames suggested in
https://codereview.chromium.org/2769723004, it is no longer necessary
for these files to use import prefixes.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2784283002 .
2017-03-30 09:16:05 -07:00
Dan Rubel 4a783d1465 move synthetic fasta closers into the token stream
* add new SyntheticSymbolToken class

* whenever fasta inserts a closer ( '}', ']', ')' ) that is not part
  of the original source, ensure that the inserted closer is
  synthetic (isSynthetic returns true) and in the token stream

* make EOF a synthetic token

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

Review-Url: https://codereview.chromium.org/2777153002 .
2017-03-29 15:02:12 -04:00
Konstantin Shcheglov 13f6976ddb Fix for top-level inference error in SourceLoader.
R=ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2776353005 .
2017-03-29 09:33:14 -07:00