Commit Graph

6018 Commits

Author SHA1 Message Date
Konstantin Shcheglov b9a1a29f2b Rename xFunctionBody to xBlockFunctionBody. Document related listener methods.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2747853002 .
2017-03-14 10:47:31 -07:00
danrubel 9c30d9ddb6 cleanup duplicate fasta scanner methods
R=ahe@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2750813002 .
2017-03-14 12:57:09 -04:00
Paul Berry 1613120822 Fix documentation for Listener.endLibraryName.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2754463002 .
2017-03-14 09:40:00 -07:00
danrubel 4c050a6a6a fasta.Keyword implement analyzer.Keyword
* update fasta.Keyword to implement analyzer.Keyword
* update analyzer.Keyword to have fasta.Keyword consts
* make analyzer.Keyword abstract

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2746023003 .
2017-03-14 11:26:30 -04:00
Konstantin Shcheglov 08eba174cc Add support for parsing annotations with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2748763003 .
2017-03-14 06:53:35 -07:00
Peter von der Ahé 4d302b0adb Enable colors on-demand.
R=kustermann@google.com, sortie@google.com

Review-Url: https://codereview.chromium.org/2746963002 .
2017-03-14 14:23:21 +01:00
Konstantin Shcheglov e41922501b Create DeclaredSimpleIdentifier when parse a declaration with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2749643002 .
2017-03-13 13:12:57 -07:00
Paul Berry 71304714d4 Revert "Add support for metadata on type variables to Fasta parser."
This caused test failures.  See for example:
https://build.chromium.org/p/client.dart/builders/vm-kernel-linux-release-x64-be/builds/1641

This reverts commit 5d8d01cdf7.

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

Review-Url: https://codereview.chromium.org/2749623003 .
2017-03-13 12:29:38 -07:00
Konstantin Shcheglov 2a0bd99f8f Fix for parsing named constructors with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2742283003 .
2017-03-13 10:50:02 -07:00
Paul Berry 59b3ca5fa2 Change the calling conventions for Parser.reportUnrecoverableError.
As with a680416716, we change the
calling conventions so that the return value is a token whose "next"
pointer points to the token from which parsing should proceed.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2744113002 .
2017-03-13 10:48:34 -07:00
Paul Berry daa9d525e7 Add an argument to handleFunctionBodySkipped.
This is necessary for listeners that skip function bodies but still
parse expressions; it indicates to them whether they need to drop an
expression from their stack.

I will be adding such a listener in a future CL.

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

Review-Url: https://codereview.chromium.org/2738053010 .
2017-03-13 10:46:34 -07:00
Paul Berry f574a058b2 Create a special PrecedenceInfo for use during parser recovery.
R=ahe@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2744843003 .
2017-03-13 10:40:59 -07:00
Paul Berry 5d8d01cdf7 Add support for metadata on type variables to Fasta parser.
R=ahe@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2738013002 .
2017-03-13 10:19:22 -07:00
danrubel ac947cd6d0 remove unused KeywordToken import
Review-Url: https://codereview.chromium.org/2746043004 .
2017-03-13 12:11:01 -04:00
Konstantin Shcheglov e12dc7c2f8 Fix for parsing EmptyFunctionBody with Fasta.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2742233002 .
2017-03-13 09:05:42 -07:00
Dan Rubel deb6eb8f82 update fasta scanner to always generate INDEX or INDEX_EQ tokens
* updated scanner to always generate INDEX and INDEX_EQ for "[]" and "[]="
* updated parser to generate ErrorKind.EmptyOptionalParameterList when "[]" detected
* updated unparser to prevent INDEX token from being generated as [][]

Take 2 of https://codereview.chromium.org/2744463003/

Fix https://github.com/dart-lang/sdk/issues/28665

Review-Url: https://codereview.chromium.org/2747683003 .
2017-03-13 10:59:41 -04:00
Peter von der Ahé e1771d951d Don't crash on non-forward labels in switches.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2743323003 .
2017-03-13 15:54:08 +01:00
Peter von der Ahé 64678dbe36 Don't crash on static/non-static acccessors.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2748673002 .
2017-03-13 14:00:03 +01:00
Peter von der Ahé 4f6d58fc50 Implement nested switches and missing switch continue targets.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2746923002 .
2017-03-13 13:52:39 +01:00
Peter von der Ahé 36a0d8cf30 Reject non-local jumps.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2739203006 .
2017-03-13 13:40:44 +01:00
Peter von der Ahé e12e5350b1 Correctly handle abstract non-sync methods.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2743963002 .
2017-03-13 13:33:37 +01:00
Peter von der Ahé 3447c3fdc8 Increase coverage of crash reporting.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2740343002 .
2017-03-13 13:25:29 +01:00
danrubel 75c23fec4b Revert "update fasta scanner to always generate INDEX or INDEX_EQ tokens"
This reverts commit b8d318e94e.

Review-Url: https://codereview.chromium.org/2746543007 .
2017-03-12 18:44:05 -04:00
danrubel c330fc471f fix missed rename fasta.Token.value --> lexeme
Review-Url: https://codereview.chromium.org/2748583002 .
2017-03-12 14:27:29 -04:00
danrubel b8d318e94e update fasta scanner to always generate INDEX or INDEX_EQ tokens
* updated scanner to always generate INDEX and INDEX_EQ for "[]" and "[]="
* updated parser to generate ErrorKind.EmptyOptionalParameterList when "[]" detected
* updated unparser to prevent INDEX token from being generated as [][]

Fix https://github.com/dart-lang/sdk/issues/28665

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2744463003 .
2017-03-12 14:19:25 -04:00
danrubel 42f6586f36 rename fasta.Token.value --> lexeme
This renames the fasta.Token.value field to .lexeme so that
it will not collide with an already existing analyzer.Token accessor.

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

Review-Url: https://codereview.chromium.org/2738313002 .
2017-03-12 13:16:14 -04:00
Konstantin Shcheglov 98c52157dc Parse factory constructors with Fasta.
R=paulberry@google.com, ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2747583003 .
2017-03-12 09:56:45 -07:00
Paul Berry a5b32faec1 Fix front_end.iml after tool/fasta rename.
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2740383002 .
2017-03-10 12:30:14 -08:00
Paul Berry ab39f0584b Minor clean-ups to token_stream_rewriter.dart.
R=ahe@google.com, danrubel@google.com

Review-Url: https://codereview.chromium.org/2743673003 .
2017-03-10 09:11:57 -08:00
Peter von der Ahé 9514a2c231 Shell script to ease running fasta tools.
Fixes https://github.com/dart-lang/sdk/issues/29000

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2740323002 .
2017-03-10 17:19:08 +01:00
Peter von der Ahé c8d49070df Implement correct label scope.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2739343003 .
2017-03-10 15:19:52 +01:00
Peter von der Ahé 3464cfbb08 Error on part of self.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2745583007 .
2017-03-10 14:25:47 +01:00
Peter von der Ahé 0342796463 Handle exports of invalid types.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2738423002 .
2017-03-10 14:19:45 +01:00
Peter von der Ahé d1bdc9596d Improve detection of compile-time errors.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2739213004 .
2017-03-10 14:14:49 +01:00
Peter von der Ahé c19b49ff26 Move most of kernel-service.dart to package:front_end.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2738253003 .
2017-03-10 13:10:28 +01:00
Peter von der Ahé a1c29b1fb3 Handle bad factory names correctly.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2741753002 .
2017-03-10 09:07:14 +01:00
Peter von der Ahé 5b8d5a12f5 Deal with bad supertypes when installing default constructors.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2745583002 .
2017-03-10 08:44:12 +01:00
Jens Johansen f8588ba47c [fasta] Add and correct more offsets
E.g. on

StringConcatenation
ListLiteral
MapLiteral
Throw
VariableDeclaration
break
continue
++i
i++

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2743633003 .
2017-03-10 08:17:15 +01:00
Peter von der Ahé 3c6b48a08e Document how to test after making changes to Fasta.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2737403002 .
2017-03-10 08:10:32 +01:00
Paul Berry a680416716 Change the calling conventions for handleUnrecoverableError.
Instead of returning the token from which parsing should proceed, it
returns a token whose "next" pointer points to the token from which
parsing should proceed.

The rationale is that when error recovery is performed in the context
of the analyzer, the listener will need to insert synthetic tokens
into the token stream which will then be passed to listener methods;
the change in calling conventions allows the listener to return the
synthetic token to the parser.

The other listeners don't need to insert synthetic tokens into the
token stream; they just need to create a synthetic token whose "next"
pointer points to the token from which parsing should proceed.  The
convenience method "newSyntheticToken" is added for the benefit of
these listeners.

No code is affected outside of error handling, so the performance
impact when compiling correct code should be zero.

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

Review-Url: https://codereview.chromium.org/2738903002 .
2017-03-09 13:52:41 -08:00
danrubel 516646735d cleanup and improve A/B fasta test harness
* Update harness to show 99.9% best and worst case

* Moved compile summary functionality
  from pkg/front_end/tool/fasta/compile.dart
  into pkg/front_end/lib/src/fasta/outline.dart

* Modified outline.dart to output a JSON summary
  containing elapse execution times if -Dsummary=true

* Moved all statistical calculations into abcompile.dart

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

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

* Address comments in
  https://codereview.chromium.org/2734863003/

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2739963002 .
2017-03-09 14:07:43 -05:00
Peter von der Ahé 6ac2b0ced4 Make parser and scanner suites able to run standalone.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2737753002 .
2017-03-09 14:57:06 +01:00
Peter von der Ahé 00898fcade Don't crash on generic methods.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2738613005 .
2017-03-09 14:49:05 +01:00
Peter von der Ahé c7b3f9ba98 Report a parse error when recovery fails.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2739853003 .
2017-03-09 14:36:27 +01:00
Peter von der Ahé 95715d66ac Compile-time errors instead of internal errors.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2735393002 .
2017-03-09 14:07:33 +01:00
Peter von der Ahé 7584921253 Fix crash when reporting error involving constructor.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2738713004 .
2017-03-09 13:50:31 +01:00
Peter von der Ahé 471c0852ce Report compile-time error instead of crashing when encountering bad parts.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2736263002 .
2017-03-09 13:42:30 +01:00
Peter von der Ahé d1a2839a50 Recover correctly from positional argument after named argument.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2733413002 .
2017-03-09 13:33:58 +01:00
Peter von der Ahé 3ed36f5c46 Install default constructors on broken mixin applications.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2732293004 .
2017-03-09 13:12:34 +01:00
Peter von der Ahé 8608d1b436 Use correct types on cloned constructors in mixin applications.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2736103004 .
2017-03-09 12:52:00 +01:00