Commit Graph

536 Commits

Author SHA1 Message Date
Dan Rubel 99acf35ede fix indexed super constructor
This fixes a bug where the AstBuilder fails
given a constructor of the form:

class C {
  C() : super()[];
}

In the process, 2 buildInitializer methods were extracted from
the AstBuilder.endInitializers method.

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

Change-Id: Icacf28b2ed0eff9b7168c97ee0c03d78e5fcd68b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-18 17:59:35 +00:00
Dan Rubel 4181185070 parse nullable function typed formal parameter
Change-Id: I502d4c6649a8974883b9ded038ce8927d34eea10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 13:37:01 +00:00
danrubel fee615c5a5 consolidate multiple modifier error codes
This consolidates the following error codes into MODIFIER_OUT_OF_ORDER

* COVARIANT_AFTER_VAR
* EXTERNAL_AFTER_CONST
* EXTERNAL_AFTER_FACTORY
* EXTERNAL_AFTER_STATIC
* STATIC_AFTER_CONST
* STATIC_AFTER_FINAL
* STATIC_AFTER_VAR

Change-Id: I3f8c41bacc65ebc5d9255806cbee89cddb5ffeb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103880
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-28 17:01:16 +00:00
Dan Rubel f4f2c77d4a improve missing body error messages
This builds on the prior CL to improve the error messages
for missing switch statement body, missing finally clause body,
and others.

Change-Id: Ia2def1f3a75d5581356c12aee4705ef21870f749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103571
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-24 17:03:25 +00:00
Dan Rubel ec1ddcdb83 improve extension message missing body error message
This improves the missing class, mixin, and extension method body
error messages and lays the groundwork for improving other
missing body error messages such as switch statement, finally clause,
and others.

Change-Id: I0a4d1338fe91eee3cfe7d61652e168df1302d212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103570
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 17:03:25 +00:00
danrubel add95652d2 fix AstBuilder invalid getter recovery
This fixes the Astbuilder recovery when encountering "get <identifier> :"
in a class body to build a method node rather than a constructor node.

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

Change-Id: I48242838d72c3a6c18e78a469b6e07fd1481d0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-22 00:28:55 +00:00
danrubel b4e2c0246c update parser to handle leading error tokens
This is the first of several CLs that move error tokens to the head
of the token stream so that parser handling of error tokens
can be simplified and less error prone.

In this particular CL:
- update parser to handle error tokens at the head of the token stream
- remove several places that analyzer was preprocessing error tokens
   now that the parser handles them

Change-Id: Iddf60ab2879567a345a692b64043bd42f1871947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-09 18:36:31 +00:00
danrubel a83fbc5edb remove unused enable lazyAssignmentOperators flag
Change-Id: I4112fe4ad5a08916d124216753a995d607a9892d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101485
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-07 13:06:39 +00:00
danrubel 79f4ecf191 report error on const method with empty body
Fix https://github.com/dart-lang/dart_style/issues/810

Change-Id: I5ff31f0cdcc89f9b05b9079698a752b875518da2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-06 20:00:38 +00:00
Paul Berry e2d0f5a50b Add featureSet parameter to Parser constructor.
And deprecate old parser configuration setters.

Change-Id: Ib1507b8d2b20be7c883061e2a92ec9205d6a378f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100664
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 16:42:19 +00:00
Paul Berry 296505e2e3 Sort declarations in pkg/analyzer/test/generated/parser_test.dart
Change-Id: Iee4ae779ddc94c0022ff04273bb54b84d2ec0eb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100403
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-24 17:18:32 +00:00
Dan Rubel ec79fc2ff4 update AstBuilder to process "late" modifier
Change-Id: I97530583b059a39d502469079940ffc5b8d4db71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-22 19:34:33 +00:00
Dan Rubel b8a9711489 Update AstBuilder to handle "required" modifier
Change-Id: I68a3f0abd405119ccc52dc9263860129fff7453a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99486
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-17 21:19:51 +00:00
Dan Rubel 81e554ea43 parse "required" modifier for NNBD
This updates the parser to recognize the "required" modifier
but always reports an error when it is detected.
A subsequent CL will update the listeners to handle the new modifier.

This also cleans up ModifierContext initialization
and adds a new pseudo-keyword-used-as-type test

Change-Id: I83f9a6b410c2bfb3476e691d3e8482bf7c97b0dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99643
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-17 17:54:00 +00:00
danrubel 0b6c61dbd3 tests for issue 36055
Change-Id: I1ccd5deb6cff6e046895220ffdd03842ec5c20d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-15 19:28:45 +00:00
danrubel 5dd89ef9a0 fix invalid var init parser recovery
Fix https://github.com/Dart-Code/Dart-Code/issues/1548

Change-Id: Ib593c17fa8dfcee3c8ad139b72ceff56497d43a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99093
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-11 18:42:02 +00:00
Brian Wilkerson 5f0de26d48 Clean up the remaining copyright notices
Change-Id: If099be4f71ba551df0dc3d69815ae6a9f55d1eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97781
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-24 20:11:28 +00:00
danrubel 4cd410d6ac add parser listener handleErrorToken event
Change-Id: I11ae5f8d25248b9cc3586edbc6e49037d99bb5a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97555
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-03-22 13:36:35 +00:00
Paul Berry 7d277c4a32 Introduce methods and classes to replace "2" variants left over from "UI as code" work.
The AST refactor for "UI as code" left behind a few things whose names
ended in "2".  This CL deprecates those things and creates
replacements that don't end in "2", so that we keep the API clean.  In
a future breaking change release of the analyzer we'll remove the
deprecated things.

The following methods and classes are added:
- ForStatement and ForStatementImpl
- ListLiteral.elements
- SetOrMapLiteral.elements
- AstVisitor.visitForStatement
- AstFactory.forStatement
- NodeLintRegistry.addForStatement

The following methods and classes are deprecated:
- ForStatement2 and ForStatement2Impl
- ListLiteral.elements2
- SetOrMapLiteral.elements2
- AstVisitor.visitForStatement2
- AstFactory.forStatement2
- NodeLintRegistry.addForStatement2

In a similar way to how we did the previous stage of AST migration,
the existing visitors have been modified so that the default
implementation of visitForStatement2 redirects to visitForStatement;
this allows clients to change their overrides of visitForStatement2 to
override visitForStatement instead.  Once all clients have been
migrated we will be able to delete the visitForStatement2 method.

Change-Id: Ife5949071fe4cb50791cd4f2f4b99a1bfaad54c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97360
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-20 22:58:55 +00:00
Dan Rubel 58a0487125 more tests for 34610 and 36009
https://github.com/dart-lang/sdk/issues/34610
https://github.com/dart-lang/sdk/issues/36009

Change-Id: I840047fe53fe99b0e2c8b778a84b0598334ab295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-03-05 18:00:31 +00:00
Dan Rubel e033b676dd fix parser crash in unterminated string literal inside unterminated interpolation
Fix https://github.com/dart-lang/sdk/issues/35900

Change-Id: I96d83e0c93d9e9c22d5b30048dc210672b1c003c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95043
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-03-05 15:35:58 +00:00
Paul Berry 62df51cb34 Eliminate uses of old AST node types from parts of the analyzer
This CL covers the following subdirectories:
- pkg/analyzer/test/dart/element
- pkg/analyzer/test/generated

Change-Id: If550fef4c625efca7a295d59fbe08f6b5be4407f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95261
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-04 19:19:13 +00:00
Brian Wilkerson 122aa43ef6 Convert ListLiteral and remove uses of ListLiteral2
Change-Id: I6c6f60ae969deb798cdbc8572341f2a51256b194
Reviewed-on: https://dart-review.googlesource.com/c/93341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-15 16:17:28 +00:00
Brian Wilkerson 5fe0202b0b Unify MapElement and CollectionElement
Change-Id: Ia1be138d656d07bdf4c11640b79044abbc798986
Reviewed-on: https://dart-review.googlesource.com/c/92762
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-12 17:10:58 +00:00
Dan Rubel 213cfdc85e Update AstBuilder to generate new for statement structure
... if control flow or spread collection entries are enabled.

Change-Id: I8718c1f7a649b7a2a7c9e376a6bf67c1df0542cf
Reviewed-on: https://dart-review.googlesource.com/c/91320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-29 17:53:58 +00:00
Konstantin Shcheglov d09c1265e9 Issue 35467. Move ast_type_matchers/element_type_matchers into test/util/.
R=brianwilkerson@google.com, paulberry@google.com

Fixes https://github.com/dart-lang/sdk/issues/35467
Change-Id: I2aab476e2e88f5bdbf5e62a2104ff7d271a73209
Reviewed-on: https://dart-review.googlesource.com/c/88780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-09 04:46:39 +00:00
danrubel 2cb346bd0c Add support for parsing complex nullable types
Change-Id: I38a59f96e299387b7266e46082d876105eb60f1e
Reviewed-on: https://dart-review.googlesource.com/c/88640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-01-08 15:52:54 +00:00
danrubel f0377b2f92 Add support for parsing simple nullable types
... as part of adding NNBD as outlined in
https://github.com/dart-lang/language/issues/110

This only supports parsing simple nullable types
such as int? and List<int>? while subsequent CLs
will add support for parsing more complex types.

Due to current parser limitations, it also only supports
nullable types in a limited number of statements such as

T? t;
if (x is String?) {}

In addition, address comments in
* https://dart-review.googlesource.com/c/sdk/+/87880
* https://dart-review.googlesource.com/c/sdk/+/87881

Change-Id: Ife4afadc0b72906fc0c4e9b1977ad838041c2a84
Reviewed-on: https://dart-review.googlesource.com/c/87920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-21 12:36:07 +00:00
danrubel e54ae42106 Add more conditional expression parser tests
This also addresses a comment in https://dart-review.googlesource.com/c/sdk/+/87083

Change-Id: Id2398bdf0e2ece76c74e0b0afdb6aa166dd687ac
Reviewed-on: https://dart-review.googlesource.com/c/87340
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-12-17 03:23:06 +00:00
Konstantin Shcheglov 162d0d12b0 Remove EngineTestCase.assertInstanceOf and extract ast/element TypeMatcher(s).
R=brianwilkerson@google.com

Change-Id: I9c47b4a7426dccafb8d3ffc1b0652da0106f2184
Reviewed-on: https://dart-review.googlesource.com/c/87302
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-12-14 17:51:27 +00:00
danrubel e2007126eb Revert support for simple nullable type return value in generalized function type
This reverts commit 11d081d115

Reason for revert: Breaks parsing less common conditionals (e.g. b ? c = true : g();)

Original change's description:
> Add support for simple nullable type return value in generalized function type
>
> This only supports nullable return values of the form
>
> <identifier> '?' 'Function' '(' ...
>
> This is an increment CL in the ongoing effort to add nullable type support
> as outlined in https://github.com/dart-lang/language/issues/110

Change-Id: I99bce29619d4e448193e3c81fa86a982791b1f77
Reviewed-on: https://dart-review.googlesource.com/c/87283
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-12-14 16:48:18 +00:00
Dan Rubel 6376482e20 Revert "Add support for prefixed nullable type"
This reverts commit 7720689931.

Reason for revert: Breaks parsing less common conditionals (e.g. b ? c = true : g();)

Original change's description:
> Add support for prefixed nullable type
> 
> This adds support for nullable types of the form
> 
> <identifier> '.' <identifier> '?'
> 
> and
> 
> <identifier> '.' <identifier> '?' 'Function' '(' ...
> 
> This is an increment CL in the ongoing effort to add nullable type support
> as outlined in https://github.com/dart-lang/language/issues/110
> 
> Change-Id: I526aecbe64bacbd442cea0b4c52d36ff23b0443b
> Reviewed-on: https://dart-review.googlesource.com/c/87083
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Dan Rubel <danrubel@google.com>

TBR=brianwilkerson@google.com,danrubel@google.com

Change-Id: Ib5e74b4aad239f561a33eae9d95dffa2693037f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/87282
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-14 15:12:51 +00:00
danrubel 7720689931 Add support for prefixed nullable type
This adds support for nullable types of the form

<identifier> '.' <identifier> '?'

and

<identifier> '.' <identifier> '?' 'Function' '(' ...

This is an increment CL in the ongoing effort to add nullable type support
as outlined in https://github.com/dart-lang/language/issues/110

Change-Id: I526aecbe64bacbd442cea0b4c52d36ff23b0443b
Reviewed-on: https://dart-review.googlesource.com/c/87083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-13 23:24:04 +00:00
Dan Rubel 11d081d115 Add support for simple nullable type return value in generalized function type
This only supports nullable return values of the form

<identifier> '?' 'Function' '(' ...

This is an increment CL in the ongoing effort to add nullable type support
as outlined in https://github.com/dart-lang/language/issues/110

Change-Id: I42febae9f88f7e4d8b05907988deab97c7a7425c
Reviewed-on: https://dart-review.googlesource.com/c/87081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-12 19:13:24 +00:00
Dan Rubel 089f098849 Auto generate more analyzer error codes
* MISSING_CATCH_OR_FINALLY
* STACK_OVERFLOW
* INVALID_OPERATOR_FOR_SUPER
* VAR_AND_TYPE

Change-Id: Ib308cd979f9c5644c28ab1f927fa9cc8add38269
Reviewed-on: https://dart-review.googlesource.com/c/86462
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-07 11:46:48 +00:00
Paul Berry 670f9ab49b Merge commit '65401da92251a7318e3264b816ce0c4e14701751' into analyzer 2018-12-04 15:38:21 -08:00
danrubel 848d93c0b5 Improve parser recovery given superclass field initializer
This improves upon the patch in
https://dart-review.googlesource.com/c/sdk/+/85780
to better recover given malformed constructor initializer such as

C() : super = 42;

and

C() : super.a = 42;

This also add a new FieldInitializedOutsideDeclaringClass error code
to better indicate the problem and how the user should fix it.

Change-Id: I4476c6c9fac20b0dd47970c2c81078a5c441bde1
Reviewed-on: https://dart-review.googlesource.com/c/85781
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-12-04 21:27:13 +00:00
danrubel f363c5fe79 Update AstBuilder to recover given superclass field initializer
Fix https://github.com/dart-lang/sdk/issues/35151

Change-Id: Ia21d621eb8c768b465ad32a1289b7a5e34fe77f0
Reviewed-on: https://dart-review.googlesource.com/c/85780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-12-04 21:27:13 +00:00
Paul Berry 63770042aa Merge commit '80c23f87a3e3123d7e337c1fc8bc3b5ec49b34a0' into analyzer 2018-11-30 08:12:45 -08:00
danrubel 80c23f87a3 Update more analyzer error codes to be generated
This updates more analyzer error codes to be generated
from the corresponding CFE error code.

Several of these analyzer error codes had multiple CFE error
codes mapped to them. In these situations, new analyzer error
codes were added to match the existing CFE error codes:

* EXTERNAL_FACTORY_WITH_BODY
* EXTERNAL_FACTORY_REDIRECTION
* CATCH_SYNTAX_EXTRA_PARAMETERS

Change-Id: Ib1cbb9e04d2092e4859e2cfadbcc85e03093f808
Reviewed-on: https://dart-review.googlesource.com/c/85431
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-30 15:00:36 +00:00
Paul Berry 589a823888 Cherry-pick f02e7bb374 to the analyzer branch
Original commit message:

    Rework parseLiteralSetOrMapSuffix to remove expression lookahead

    This reworks the set literal support to remove unnecessary lookahead
    by removing the listener.beginLiteralMapEntry event
    and renaming the listener.endLiteralMapEntry to handleLiteralMapEntry.

Change-Id: I608e94aadc2afb86c772fdc6ef24b0da32c5ddde
Reviewed-on: https://dart-review.googlesource.com/c/85410
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-11-28 23:53:01 +00:00
danrubel f02e7bb374 Rework parseLiteralSetOrMapSuffix to remove expression lookahead
This reworks the set literal support to remove unnecessary lookahead
by removing the listener.beginLiteralMapEntry event
and renaming the listener.endLiteralMapEntry to handleLiteralMapEntry.

Change-Id: Ia71fe69359b0447a60d729db34ec35ad25a54750
Reviewed-on: https://dart-review.googlesource.com/c/84661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-26 20:03:19 +00:00
Brian Wilkerson 032bfe0872 Use void rather than Object as a type argument when possible
Change-Id: I275a20e6f58a01adda3be64cf83930cc238beed3
Reviewed-on: https://dart-review.googlesource.com/c/84700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-11-19 18:32:31 +00:00
Paul Berry d076571cd9 Merge commit '35c6c79ebc052ab28efcaf045b38ff71c6ed5f3e' into analyzer 2018-11-08 09:32:18 -08:00
Dan Rubel 35c6c79ebc Fix parsing getter with prefixed name
Fix https://github.com/dart-lang/sdk/issues/34610

Change-Id: I7004814af69b35d143779857a6bbd4bb639e257c
Reviewed-on: https://dart-review.googlesource.com/c/83240
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-11-08 14:31:43 +00:00
Brian Wilkerson dee5e8a070 Convert more classes to mixins
Change-Id: I85bee426236a510305fc38a49b2f9348af7698df
Reviewed-on: https://dart-review.googlesource.com/c/82181
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-10-31 13:49:51 +00:00
danrubel 9f7ad8d082 Fix recovery when parsing complex type variables
This fixes parser recovery when the user has inserted a word before
a method declaration with a complex type arguments, such as

  foo Future<List<int>> bar() {}

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

Change-Id: Ic6d1767668bd34d75c6ab5f9973e5762bdd8f160
Reviewed-on: https://dart-review.googlesource.com/c/80780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-19 18:56:09 +00:00
danrubel bc2ea566f1 Auto generate more analyzer error codes
Change-Id: I7881274ef6aae22d29d35fb6be084be873f929b8
Reviewed-on: https://dart-review.googlesource.com/c/79602
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-12 20:58:34 +00:00
Dan Rubel e4c3fa0a9c Improve recovery when parsing named constructor invocation with invalid type arguments
The parser now generates a ConstructorWithTypeArguments error and a new
handleInvalidTypeArguments event after a begin/endTypeArguments event pair
when those type arguments are in a syntatically invalid location.

For example: `new C.n<int>();` in
```
class C<T> { T f; C.n() {} }
main() { var x = new C.n<int>(); }

Most listeners handle this event by dropping the invalid type arguments,
but AstBuilder now preserves those invalid type arguments in the AST
to support better code quick-fixes/quick-assists/refactoring.

Change-Id: I5b22bd4903cd9ee3645936b9a108598b603cf9ca
Reviewed-on: https://dart-review.googlesource.com/c/79300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-10-11 19:57:22 +00:00
Konstantin Shcheglov 4df3626d19 Remove support for (non)nullable types from Analyzer.
R=brianwilkerson@google.com

Change-Id: Ia26c203ed4fa238d1a546fe67e009fa542ed8f82
Reviewed-on: https://dart-review.googlesource.com/77666
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-02 20:05:15 +00:00