Commit Graph

6018 Commits

Author SHA1 Message Date
Jens Johansen e553775b9c [fasta] Add and correct offsets on nodes
BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2736093003 .
2017-03-09 10:31:52 +01:00
Paul Berry b505603f5f Create a TokenStreamRewriter class.
This class will allow parser error recovery to insert synthetic tokens
into the token stream.  It makes use of Token.previousToken when it's
available, but does not depend on it; when it's not available, it
falls back on heuristics which should still be fast, and which don't
impose any performance burden until the first synthetic token is
inserted.

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2732193007 .
2017-03-08 13:40:31 -08:00
Jens Johansen 15dc449cea [Fasta] Offset and end offset on procedures
BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2731553004 .
2017-03-08 09:23:41 +01:00
Paul Berry a6ee0dfd3f Add support for documentation comments to most of AstBuilder.
This CL addresses all use cases except for documentation comments on
type parameter formals.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2732363002 .
2017-03-07 14:19:53 -08:00
Konstantin Shcheglov dc2c7df603 Add 'withKeyword' to mixin application with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2735973004 .
2017-03-07 13:27:50 -08:00
Paul Berry 2db4230533 Fix a few instances of TypeName in AstBuilder (should be TypeAnnotation).
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2734113004 .
2017-03-07 13:16:42 -08:00
Konstantin Shcheglov ed289f64cd Fix for parsing default parameters.
In analyzer we decide whether to create DefaultFormalParameter by the
fact of being in [] or {}, not by the fact of presence of a default
value.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2740573002 .
2017-03-07 12:20:36 -08:00
Konstantin Shcheglov fe4378d2c8 Fix for parsing generic function types with Fasta.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2732213003 .
2017-03-07 12:03:55 -08:00
Konstantin Shcheglov 271ea5a551 Parse script tags with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2738693004 .
2017-03-07 11:59:14 -08:00
danrubel dd3ab83eee add previous token field
This adds fasta Token.previous and sets that field to point
to the previous token in the fasta token stream.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2739583002 .
2017-03-07 13:03:52 -05:00
danrubel 69ad5c37a1 move comment tokens into preceedingComments field
Fix https://github.com/dart-lang/sdk/issues/28850

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2731863002 .
2017-03-07 12:50:33 -05:00
Konstantin Shcheglov 91cf66ed5d Fix for parsing empty compilation units with Fasta.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2738693003 .
2017-03-07 09:48:29 -08:00
Peter von der Ahé 2934dfaf16 Avoid crashing on function syntax.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2730093002 .
2017-03-07 16:54:09 +01:00
Jens Johansen a58fe4898d [Fasta] include source code in dill
At least for now, only when passing --include-source

BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2729913005 .
2017-03-07 15:48:25 +01:00
Peter von der Ahé b05dacd6f6 Add missing test from previous CL.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2728123002 .
2017-03-07 14:57:47 +01:00
Peter von der Ahé ac9d87b707 Keep track of references to guide.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2739593004 .
2017-03-07 14:50:57 +01:00
Peter von der Ahé 3835ccf907 One shared guide for diagnostics.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2718023003 .
2017-03-07 13:44:39 +01:00
Konstantin Shcheglov bf4dd380ea Fix for parsing 'rethrow' statement with Fasta.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2730293003 .
2017-03-06 16:50:28 -08:00
danrubel c354e26fb6 A/B fasta performance measurement harness
Tweak and reapply https://codereview.chromium.org/2731703003/

Review-Url: https://codereview.chromium.org/2734863003 .
2017-03-06 14:30:47 -05:00
Konstantin Shcheglov 262cee7864 Add support for parsing #void with Fasta.
For the reason why we need this, see the following documents.
https://codereview.chromium.org//427603002
https://github.com/dart-lang/sdk/issues/20191
https://github.com/dart-lang/sdk/issues/19972

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

Review-Url: https://codereview.chromium.org/2737593002 .
2017-03-06 11:24:54 -08:00
Konstantin Shcheglov 2a60cbf9de Fix for parsing 'const X()' with Fasta.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2733913002 .
2017-03-06 11:00:32 -08:00
danrubel 8552edb9b3 Revert "A/B fasta performance measurement harness"
This reverts commit 82685eacbf.

Review-Url: https://codereview.chromium.org/2733033002 .
2017-03-06 10:59:51 -05:00
Konstantin Shcheglov be521515fe Parse #operator symbol literals with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2735623002 .
2017-03-06 07:47:46 -08:00
danrubel 82685eacbf A/B fasta performance measurement harness
Given two separate Dart SDK repo clones, A and B,
this pkg/front_end/tool/fasta/abcompile.dart harness
alternately runs

<A>/pkg/front_end/tool/fasta/compile.dart
then
<B>/pkg/front_end/tool/fasta/compile.dart

so that a performance comparison can be made of the difference
between fasta in A vs B.
For example, from the <A> root directory:

xcodebuild/ReleaseX64/dart
  -DbRoot=/path/to/2nd/dart/sdk/repo
  -Diterations=15
  pkg/front_end/tool/fasta/abcompile.dart
  --compile-sdk=xcodebuild/ReleaseX64/patched_sdk/
  pkg/compiler/lib/src/dart2js.dart
  --verbose

The output contains the raw data along with a summary
of the average difference, and is formatted in a way
that can be easily pasted into Google Sheets
for further analysis.

Future improvements to this include:

* Add JSON output to pkg/front_end/tool/fasta/compile.dart
  so that abcompile.dart is not text scraping the numbers

* Adjust pkg/front_end/tool/fasta/compile.dart so that --verbose
  is not needed to capture the needed numbers and progress

* tweak the A/B summary section to paste more easily
  into Google Sheets

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2731703003 .
2017-03-06 10:09:45 -05:00
Dmitry Olshansky 8dda473a55 Improve fasta scanner performance
Reorder cases in bigSwitch according
to frequency, reduce the number of
comparisons.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2711403002 .
2017-03-06 11:35:28 +01:00
Paul Berry a2c4fe177f Update .iml files.
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2734723002 .
2017-03-05 11:58:36 -08:00
Peter von der Ahé 3873b0fc83 Recover from bad supertypes.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2729943003 .
2017-03-03 15:06:09 +01:00
Vyacheslav Egorov c0c87b0afd GN: change the way we specify dependencies for the patched_sdk target.
Instead of listing all files as inputs in GN script using Python helper we make
patch_sdk.dart generate a depfile that Ninja can use:

            https://ninja-build.org/manual.html#_depfile

This prevents breakages when some dependencies are deleted and GN is not rerun.

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

Review-Url: https://codereview.chromium.org/2729503006 .
2017-03-03 14:52:51 +01:00
Peter von der Ahé ff89087641 Recover correctly from this-parameter on non-constructors.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2727313004 .
2017-03-03 12:40:30 +01:00
Peter von der Ahé 2af498fc84 Recover from missing arguments in new expression.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2730763002 .
2017-03-03 10:31:19 +01:00
Jens Johansen f979537725 [Fasta] Include line starts
BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2731633003 .
2017-03-03 10:29:56 +01:00
Peter von der Ahé 790df00dc6 Recover correctly from empty optional parameters.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2725093003 .
2017-03-03 10:26:13 +01:00
Peter von der Ahé 6f550ef4ea Correctly recover from incorrect imports, etc.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2725973004 .
2017-03-03 10:10:00 +01:00
Peter von der Ahé bffd9e28ac Implement deps files in compile_platform.dart.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2730743002 .
2017-03-02 16:15:42 +01:00
Peter von der Ahé 88a92f805a Move all main methods to tool/.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2722223006 .
2017-03-02 14:41:06 +01:00
Peter von der Ahé 628be2b36a Apply transformers and other work arounds to get boostrapping to work.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2723173002 .
2017-03-02 14:31:58 +01:00
Peter von der Ahé 6176847e36 Consolidate analyzer dependencies.
This allows us to create a smaller .dill file for Fasta.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2723113002 .
2017-03-02 12:59:47 +01:00
Peter von der Ahé 369c94815d Rename FeContext to FastaContext.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2726843003 .
2017-03-02 12:38:32 +01:00
Peter von der Ahé c59ecd801c Remove package imports from itself.
Without this, we risk creating two different libraries at runtime. One
named file:///something/ and one named package:front_end/something.
These libraries are different and if enums from one gets mixed with
the other, you get very confusing errors (to apparently identical enums
aren't equal).

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2726793003 .
2017-03-02 12:34:46 +01:00
Konstantin Shcheglov ce58e89d3c Fix parsing [a]sync[*] function body modifiers with Fasta.
The Fasta'a parser is crazy as it is now. It says that something is a
return statement, but it is actually an expression function body. That
seems too much dart2js specific.

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

Review-Url: https://codereview.chromium.org/2728773002 .
2017-03-01 16:20:20 -08:00
Paul Berry c6d1a0d381 Re-remove AstBuilder.accumulateIdentifierComponents.
This was removed in 3fbeb5d064 and
accidentally re-introduced in 4500bb0920
(presumably due to merge conflict resolution).

Review-Url: https://codereview.chromium.org/2724143002 .
2017-03-01 15:30:34 -08:00
Paul Berry 70408f7549 Add a data structure to keep track of modifiers in AstBuilder.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2725983002 .
2017-03-01 14:43:11 -08:00
Paul Berry 8decc11ac0 Add AstBuilder support for fields.
R=ahe@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2723883002 .
2017-03-01 13:24:17 -08:00
Konstantin Shcheglov 9fa139215b Parse 'x.y' as PrefixedIdentifier, not PropertyAccess with Fasta.
OTOH, 'x?.y' or '(x).y' should be parsed as PropertyAccess.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2722283002 .
2017-03-01 13:12:51 -08:00
Konstantin Shcheglov 86b5a088ad Parse InstanceCreationExpression with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2727753002 .
2017-03-01 13:04:46 -08:00
Konstantin Shcheglov 93bf98045c Fix parseAssignableSelector() tests and parse '?.' with Fasta.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2727663005 .
2017-03-01 11:33:22 -08:00
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