Johnni Winther
1683fd5c16
[_fe_analyzer_shared] Ensure beginToken on class, enum, mixin, extension and extension type
...
This passes the first token of these top level declaration directly
to the endX listener method.
In the CFE this is used to ensure that can handle the new modifiers in
the textual outline. Furthermore, support for extension types is added
and having an "unknown chunk" now results in an error. The latter should
help us keep the textual outline up-to-date wrt new features.
Change-Id: I813d6162b6cba0a2bf550ed33a6091abf9bf49f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324702
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2023-09-15 13:01:10 +00:00
Johnni Winther
b745fa8923
[cfe] Avoid "Instance of " in parser intertwined test expectations
...
Change-Id: I7d7b1c9a001c43ec160d26c478bd71b41505f273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323361
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-09-04 13:06:29 +00:00
Johnni Winther
b1594fa130
[parser] Handle invalid extension type header in error recovery
...
This expands the existing recovery for class headers to handle
invalid, out-of-order, and duplicate clauses in extension type
declaration headers.
Change-Id: I7b33b91cc718e4c0673137121b8d083fa0ef1562
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321900
Reviewed-by: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2023-08-24 11:20:18 +00:00
Johnni Winther
29003657e2
[parser] Remove support for 'inline class' syntax
...
+ removes tests using 'inline class' syntax or replace them with
extension type syntax.
TEST=existing
Change-Id: Ic98178c4df9a1585ad0167cfd8847caa7b771e3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321120
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2023-08-22 11:26:54 +00:00
Kallen Tu
f7bc72fce6
[analyzer/cfe] Remove interface mixin, final mixin and sealed mixin.
...
Added error messages for when users try to use invalid mixins + a language test that tests that (and tests in each of the front ends).
Removed the tokens from the parser listeners.
Removed all behaviours and error reporting related to these invalid mixins.
Change-Id: I558595826dae7e2c176bd1929e97caa2335c167c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290614
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2023-03-30 11:56:08 +00:00
Kallen Tu
0936bceaa0
[cfe] Remove tests that use interface mixins, final mixins and sealed mixins.
...
Remove/change some frontend tests to make for easier removal of these invalid
mixins in https://dart-review.googlesource.com/c/sdk/+/290614 .
Change-Id: I50325b8275704eb2542c5871bb6326356bd9b020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291053
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2023-03-27 18:56:46 +00:00
Konstantin Shcheglov
67e7c96962
Fix parser to use correct begin token, to get documentation comments from it.
...
Change-Id: I9505353c9c6c00082e588aced34e8151c7ab22b7
Bug: https://github.com/dart-lang/sdk/issues/51447
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284441
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2023-02-22 17:03:38 +00:00
Kallen Tu
57107ae59b
[analysis_server] Add code completion for class modifiers at the beginning of a declaration.
...
Change-Id: I9dc1d80264d052c8f2ac75978e64280bd271f8d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2023-02-21 19:31:55 +00:00
Kallen Tu
ca974e5c4f
[analyzer/cfe] Reland: Parse final class modifier.
...
Reland same files as https://dart-review.googlesource.com/c/sdk/+/278090
The only major change is parser_impl.dart parsing changes for 'final'
This change should allow 'final' for classes and mixins and maintain prior final behaviour for other constructs such as enums, typedefs, or the breaking line which was 'final library = ...;'
Change-Id: I3d84fc47479f39df6d5b0dcbe8f92d1fb78a826a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279076
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2023-01-19 16:08:28 +00:00
Kallen Tu
ed1157acc4
Revert "[analyzer/cfe] Parse final class modifier."
...
This reverts commit 2f1372b460 .
Reason for revert: Breaks the build. Unsure if there are other affected failures.
Original change's description:
> [analyzer/cfe] Parse final class modifier.
>
> Change-Id: Ia554c4f8f9617cc883a472eeb819aab2fd849077
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278090
> Reviewed-by: Johnni Winther <johnniwinther@google.com >
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
> Commit-Queue: Kallen Tu <kallentu@google.com >
TBR=scheglov@google.com ,johnniwinther@google.com ,kallentu@google.com ,dart-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I5dd74202bd46d69b7261d6d30d8cf3b1a40dbc99
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279040
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2023-01-13 21:04:01 +00:00
Kallen Tu
2f1372b460
[analyzer/cfe] Parse final class modifier.
...
Change-Id: Ia554c4f8f9617cc883a472eeb819aab2fd849077
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278090
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2023-01-13 19:16:20 +00:00
Kallen Tu
4aaf1a2cb1
[analyzer/cfe] Parse base and interface class modifiers
...
Change-Id: I52f8ac53ec504b4c1d07c04744b4b079a1163dfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277721
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2023-01-12 18:47:39 +00:00
Kallen Tu
2083db9cdb
[cfe] Emit error for mixing in class outside of its library except mixin classes.
...
It is an error to mix in a class declaration that does not have the 'mixin' modifier, outside of its library for class declarations in a library version lower than sealed class' release version.
Change-Id: I318bb243705748eae60482b6c3513669f1cbb90c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275440
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2022-12-29 21:26:00 +00:00