Commit Graph

4770 Commits

Author SHA1 Message Date
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é 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
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
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
Peter von der Ahé 695ebae97a Complain about bad operator parameters.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2782843002 .
2017-03-29 13:12:41 +02:00
Peter von der Ahé a62c5631bf Use message.yaml in parser.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2778213002 .
2017-03-29 11:02:23 +02:00
Peter von der Ahé 2aa0e1976d Improve semantics of parts.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2781623003 .
2017-03-29 10:48:52 +02:00
Peter von der Ahé a49bc60120 Handle complicated imports.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2780543002 .
2017-03-29 10:44:22 +02:00
Peter von der Ahé 2de7a24238 Handle complicated exports.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2776153002 .
2017-03-29 10:42:35 +02:00
Peter von der Ahé a6ba01e8aa Throw AbstractClassInstantiationError on abstract classes.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2781493002 .
2017-03-29 10:38:15 +02:00
Peter von der Ahé a91ebba200 Complain about assignments to parenthesized expressions.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2780483002 .
2017-03-29 10:28:05 +02:00
Peter von der Ahé e1a25e35ca Rename BuilderAccessor to FastaAccessor.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2777893002 .
2017-03-29 10:24:29 +02:00
Peter von der Ahé 0b4706ce30 Make catch variables final.
Fixes https://github.com/dart-lang/sdk/issues/28410.

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2775163003 .
2017-03-29 10:20:07 +02:00
Peter von der Ahé f979dad474 Complain about uninitialized const fields.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2774933002 .
2017-03-29 10:12:41 +02:00
Asger Feldthaus f396d919ae Remove some additional code that depended on the old type propagation.
BUG=
R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2781473004 .
2017-03-28 13:51:21 +02:00
James Robinson 2b70abd2e3 Fix computation of relative paths in depsfile when cross-compiling
Relative paths in a depsfile are interpreted by ninja relative to the
current working directory which in a GN build is the root of the build
directory ($root_build_dir in GN terms). When doing a
cross-compilation, this is different from the root of the output
directory ($root_out_dir in GN terms) for all builds other than the
target. This fixes the computation of depsfile entries so that they are
always relative to the current working directory.

Concretely, this means incremental builds in Fuchsia do not always
rerun the patch_sdk step for the host, shaving 12+ seconds off of no-op
builds.

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2776323002 .
2017-03-27 20:28:04 -07:00
Peter von der Ahé 02573b3caa Remove Fasta's copy of accessors.dart.
R=asgerf@google.com, jensj@google.com

Review-Url: https://codereview.chromium.org/2777883002 .
2017-03-27 14:04:43 +02:00
Dan Rubel 0fa52686f3 fix missing digit error translation
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2772513006 .
2017-03-25 22:33:59 -04:00
Dan Rubel 05300ea2df change "deferred" keyword isPseudo --> isBuiltIn
Fix https://github.com/dart-lang/sdk/issues/29069

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

Review-Url: https://codereview.chromium.org/2769253002 .
2017-03-25 21:20:11 -04:00
Dan Rubel 186c6f23bd fasta scanner recovery and error code translation improvements
* cleanup defaultRecoveryStrategy next/previous and eof

* add SymbolToken.eof() constructor to ensure that EOF tokens
  are correctly self referencing

* add fasta.scanString method to match scan method

* add fasta.ScannerResult.hasErrors field
  so that scan and scanString callers can quickly check for errors

* new scanner replacement test
  which scans using fasta then asserts as if it were from analyzer

* improve SymbolToken.toString() for EOF
* update analyzer test :: fasta scanner considers "<" to be an opener
* extract and move translateErrorToken into front_end
* address comments in https://codereview.chromium.org/2763833002

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

Review-Url: https://codereview.chromium.org/2767083002 .
2017-03-24 11:40:22 -04:00
Paul Berry 415c868589 Introduce a shadow hierarchy and factory class for use by fasta's BodyBuilder.
In the long run, this shadow hierarchy is intended to be used both for
kernel and analyzer ASTS; this should allow a single BodyBuilder class
to build either a kernel or an analyzer AST depending on which factory
it's connected to.

For now we only have a kernel shadow hierarchy, and it's incomplete,
so the code is not yet used.  I intend to follow up with CLs that
complete the implementation and hook it up to BodyBuilder.

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

Review-Url: https://codereview.chromium.org/2769723004 .
2017-03-24 08:25:59 -07:00
Peter von der Ahé ec5d7cba1a Implement character offsets for fields and enum constants.
R=jensj@google.com

Review-Url: https://codereview.chromium.org/2771983004 .
2017-03-24 15:29:42 +01:00
Peter von der Ahé 0c17ebba9f Report errors on non-final fields in const classes.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2775633004 .
2017-03-24 15:10:31 +01:00
Peter von der Ahé 91e290b610 Allow identical as a compile-time constant.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2770243002 .
2017-03-24 14:42:59 +01:00
Peter von der Ahé 62b39e746a Report compile-time error on invalid constructors.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2777533002 .
2017-03-24 14:11:32 +01:00
Karl Klose cf2ef53b28 Share operator names
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2756443004 .
2017-03-23 18:23:30 +01:00
Peter von der Ahé d41b344896 Allow literal symbols as constant expressions.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2769063003 .
2017-03-23 17:42:48 +01:00
Peter von der Ahé 89bcf728f9 Clean up use of identifier context.
R=paulberry@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2769813007 .
2017-03-23 16:08:32 +01:00
Peter von der Ahé 2eca8c58c3 Various errors on constant expressions.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2765283002 .
2017-03-23 13:40:25 +01:00