Johnni Winther
5baa4af7d8
[analyzer,cfe] Add 'views' feature and support for 'view class'
...
This adds the 'views' feature flag together with parser support
for 'view class'. If the feature is not enabled, an error is reported.
TEST=pkg/front_end/parser_testcases/views/...
Change-Id: I813ac86a0e7de9f0a5729c6d7ae35b82d1258ae5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265780
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
Reviewed-by: William Hesse <whesse@google.com >
2022-11-02 11:09:59 +00:00
Paul Berry
5e29849393
Parser: consolidate handleCaseMatch and endCaseExpression.
...
There was no need for both of these listener callbacks, because they
were always called together. Since `beginCaseExpression` is actually
used, it makes sense to keep `endCaseExpression` and get rid of
`handleCaseMatch`.
Change-Id: I544096b2c2b2814e8cc0c8606455855cb77c9e60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264102
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2022-10-15 13:51:59 +00:00
Paul Berry
9aab3c7746
Patterns parsing: add support for guards.
...
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I21db09c9d8c1d359e1b125eea2bae2749cdb72fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264101
Reviewed-by: Jens Johansen <jensj@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2022-10-14 20:14:20 +00:00
Paul Berry
4cf63fb382
Parser and listener API changes for supporting pattern guards.
...
These are in their own CL so that it's easy to verify that no
functionalty has changed, even though a lot of parser expectations
files are affected.
In a follow-up CL, I'll add code that actually parses pattern guards.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I79f5a02df45e29b69aa4d8348cfdf27042ada9d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264020
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2022-10-14 15:42:12 +00:00
Paul Berry
5923b883db
Parser: add support for wildcard patterns.
...
The bare identifier `_` is treated as a variable pattern wherever it
appears, even though other bare identifiers are sometimes treated as
constant patterns.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I475ef627b6d0bf519a1972aa5ec683e2d032f02b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263280
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2022-10-14 14:04:59 +00:00
Jens Johansen
27e0e84cc3
[parser] Allow parsing top-level getter called get that's async/async*/sync*
...
Change-Id: I07e9759cdf61e1b633bbc0e7cd961d80ecfedf8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263129
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2022-10-14 11:21:48 +00:00
Jens Johansen
b3dbaadc83
[parser] More corner cases for record types
...
* required is a modifier when followed by [record type] `?`.
* Parse record type as record type if followed by `super` or `?` `super`
or `?` `this`.
* Typedef with record type follow by `?`.
* Parse record type as record type in get/set with async/sync/sync*.
* Parse record type as record type when followed by `>>=` or `>>>=`
(for weird formatted use in typedefs).
Change-Id: I19e208497e28780fb1505139c488e943751cce25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-10-14 09:33:58 +00:00
Jens Johansen
c784cc7500
[parser] Don't always parse question as part of record type
...
Change-Id: I48468c2531e01a9f535e9d973c57911c28967bcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262605
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-10-07 10:11:34 +00:00
Jens Johansen
97cdb043da
[parser] Parse record type return type for operators
...
Change-Id: I23b5ef38a9bfd58c327303198e59d9b50ace323b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262681
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2022-10-07 08:59:39 +00:00
Jens Johansen
575ae24207
[parser] Parse record type question after modifier
...
Change-Id: If2dd018a79719bd0f5a9a44f46fb102c3595d08e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261644
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2022-10-07 08:52:04 +00:00
Jens Johansen
af2f4e2d29
[parser] Parse record type used in optional and named parameters
...
Fixes https://github.com/dart-lang/sdk/issues/50136
Change-Id: If02c0d86244ef9cd3685256e583b987d438307d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-10-07 06:39:08 +00:00
Jens Johansen
eb80f37103
[parser] Parse record type in for in
...
Change-Id: I96773ecf597685bd6cdfe7da9971b42aea1488e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262940
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2022-10-07 06:37:42 +00:00
Jens Johansen
e860cf241b
[parser] Empty record
...
https://github.com/dart-lang/language/pull/2535
Change-Id: I8241119ee858ce39673472056b88c9393799e1a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262600
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2022-10-06 06:34:58 +00:00
Johnni Winther
b7debf00f7
[cfe] Handle pattern events in BodyBuilder
...
This supports pattern listener events in the BodyBuilder without
crashing. Currently no AST is created and only dummy objects are put
on the stack.
Change-Id: I24a29073b578bb9aaa07e84d5177e51428074a94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262422
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-10-04 13:31:41 +00:00
Paul Berry
118f628ecf
Patterns: add support for parsing constant patterns
...
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I601248bc206d9b19521b020fadb2eccd048e0ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261701
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2022-10-03 19:46:16 +00:00
Jens Johansen
92b97fe6fb
[parser] Field formal parameter with explicit record type
...
Fixes https://github.com/dart-lang/sdk/issues/50007
Change-Id: I4cce2fd49db9a71b344d5d3e3ea1e0a941a434ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262200
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-10-03 07:14:26 +00:00
Johnni Winther
dc7df3218e
[cfe] Add parser tests for patterns
...
These tests are copied from
pkg/analyzer/test/generated/patterns_parser_test.dart
Change-Id: Ib5fd7ca8c22dd24bf5334ac87140d961bc80838a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261660
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2022-09-29 09:08:57 +00:00
Jens Johansen
a2466e26c5
[parser] Parse nested generics with records
...
Fixes https://github.com/dart-lang/sdk/issues/50005
Fixes https://github.com/dart-lang/sdk/issues/50057
Change-Id: I6c84f20093b27c4d2f51e7058295257b5d82288e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261642
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2022-09-29 07:28:47 +00:00
Jens Johansen
f9e508a0cc
[parser] Parse typedef with record return type
...
Fixes https://github.com/dart-lang/sdk/issues/49994
Change-Id: I5212b780bdd4e28c7c3afcabc72c9e65f7caecfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261604
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-09-29 06:28:36 +00:00
Jens Johansen
59f895b4ed
[parser] Don't pretend like record types doesn't exist in on clause parsing
...
Fixes https://github.com/dart-lang/sdk/issues/49980
Change-Id: I74c734a64f4c0d4bd6ad79f231411352f6b170c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261362
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-09-28 13:41:56 +00:00
Paul Berry
9eb5544ec1
Parser: split some pattern/expression parsing logic.
...
This change restores `parseParenthesizedExpressionOrRecordLiteral`,
`parseArguments`, and `parseArgumentsRest` to the way they looked
prior to adding parser support, and instead adds new methods
`parseParenthesizedPatternOrRecordPattern` and
`parseExtractorPatternRest` that are specialized for patterns parsing.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I104e031a796ef7f217cd427e1a9ae94a04dafa7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261620
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2022-09-28 12:50:56 +00:00
Paul Berry
d7e130e930
Patterns parsing: update expectations (no functional change).
...
For ease in code review, I've made all the changes that affect test
expectations files here, in a way that can easily be confirmed during
code review to have no functional effect on parser semantics.
This will be followed by a change that introduces parser support for
patterns, but doesn't affect test expectations.
Change-Id: I830600c1ae89447c7745bfae6fd91c379b6e05d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261022
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2022-09-27 12:56:54 +00:00
Sam Rawlins
51114fca8a
Unnamed libraries
...
Fixes https://github.com/dart-lang/language/issues/1073
Spec: https://github.com/dart-lang/language/blob/master/accepted/future-releases/unnamed-libraries/feature-specification.md
This work allows library directives without a name. Every single one would look like this:
```
library;
```
:) it was a little anti-climactic implementing a non-feature like this, but there it is.
The affordance for a library directive without a name is guarded by an experiment flag, `--unnamed-libraries`.
Change-Id: I8612238359e88d6082f7e89d0d0fc624fdb45273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257490
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Kevin Moore <kevmoo@google.com >
2022-09-23 05:37:39 +00:00
Jens Johansen
cec94a1446
[parser] Empty record types, record types with 1 element
...
This should bring parsing of record types up-to-date with v1.6 of
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md
Also fixes https://github.com/dart-lang/sdk/issues/49826
Change-Id: I3737a72ddee49a957bd55f86cc200fb77f23e2a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256660
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-08-30 11:04:10 +00:00
Jens Johansen
a4352d09e1
[parser] Record literals can be const and one-element only
...
This should bring parsing of record literals up-to-date with v1.6 of
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md
Change-Id: If39bb1834137da55ef8bd1923106bbc614ea319b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256461
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2022-08-30 10:54:08 +00:00
Jens Johansen
4970534cab
[parser] Allow ? to be parsed a part of the type after is/as right before end bracket
...
Before this was ok:
```
var x = [a as int?, a];
```
but this was not:
```
var x = [a, a as int?];
```
Nor was this:
```
list[i as int?];
```
Fixes https://github.com/dart-lang/sdk/issues/49678
Change-Id: I8a169e15b189965ad19ad489e8a0a6f02c09b34b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2022-08-25 13:47:22 +00:00
Jens Johansen
7aeea765d8
[parser] Parse record type return types for functions taking type parameters
...
Fixes https://github.com/dart-lang/sdk/issues/49794
Change-Id: Ie80497bcfcda42cfb082240346ed547586742598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256203
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2022-08-25 06:10:03 +00:00
Jens Johansen
bba453b798
[parser] Record type type arguments
...
Fixes https://github.com/dart-lang/sdk/issues/49769
Change-Id: Icffa2dcfae95d950c00e72aa01121b6d6ebd147d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256065
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2022-08-24 08:25:38 +00:00
Jens Johansen
cf8f47df4f
[parser] Support RecordType for setter/getters and static methods
...
Fixes https://github.com/dart-lang/sdk/issues/49709
Change-Id: I710e687ce7e1066eef8439f541f2e5fe2771db36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255988
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-08-24 07:42:51 +00:00
Johnni Winther
6751831ac6
[parser] Add hasNamedFields parameter to endRecordType
...
This makes it possible to handle named record fields without peeking
at the last record field (list) on the stack.
Change-Id: I96e2009cf5933ef505459ac8722d5bcbeb67db83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2022-08-23 15:43:10 +00:00
Jens Johansen
38e5b8f9e0
[parser] Parse Record Types
...
This is the first stab at implementing the record types from
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md
Change-Id: I15c07e05c32a95206d177521c5f2b7fed69b4fbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255244
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2022-08-19 07:04:44 +00:00
Jens Johansen
8a1dbb160f
[parser] Parse record literals
...
This is the first stab at implementing the record expressions from
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md
Change-Id: I2adb6cb3cd50d4ee45e144e86ec7011d046f6170
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253783
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Michael Thomsen <mit@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2022-08-16 06:36:36 +00:00
Jens Johansen
183863e5bf
[parser] More recovery of await in non-async context
...
Fixes https://github.com/dart-lang/sdk/issues/49116
Change-Id: I6b3f4bd88b17da5703dc268df413b3e5bb2e7d87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249605
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-06-29 07:11:06 +00:00
Jens Johansen
25dcfca3c2
[parser][CFE][analyzer] Function is builtIn keyword
...
This CL makes `Function` a builtIn keyword instead of a `pseudo` keyword.
See also (and fixes):
https://github.com/dart-lang/sdk/issues/45703
https://github.com/dart-lang/sdk/issues/45704
https://github.com/dart-lang/sdk/issues/45705
https://github.com/dart-lang/sdk/issues/49197
This undoes https://dart-review.googlesource.com/c/sdk/+/195761
This is ~a merge of https://dart-review.googlesource.com/c/sdk/+/195906
and https://dart-review.googlesource.com/c/sdk/+/200080
Change-Id: I8bfee6976d43819fa355de99b3b2429eb67a7cdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249484
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2022-06-28 14:26:33 +00:00
Jens Johansen
b3917f7d5b
[parser] Parse nullable type correctly after is/as when followed by '{'
...
E.g. nullasble cast last in initializer list followed by constructor
body.
Fixes https://github.com/dart-lang/sdk/issues/49132
Change-Id: I28633762444048b5e26b4b8343494302544344df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249602
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-06-28 12:43:03 +00:00
Jens Johansen
7052965647
[parser] Parse nullable type correctly after is/as when followed by '}'
...
Fixes https://github.com/dart-lang/sdk/issues/48999
Change-Id: I42d7ec4110bb2cd212afbf7aae694f6a867b4423
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249601
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2022-06-27 08:42:51 +00:00
Johnni Winther
36607d877a
[parser] Support 'augment super' as its own expression
...
This adds support for parsing `argument super` as its own expression
in augmentation libraries. This is not handled (correctly) by the
ast builders of analyzer and cfe yet.
Change-Id: Ibe67ad9daf56c82e8ec94f16d468e6b0d8f84d22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244922
Reviewed-by: Jens Johansen <jensj@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-05-20 09:36:52 +00:00
Johnni Winther
815ef172a8
[cfe] Add ParameterBuilder and FunctionTypeParameterBuilder
...
Adds ParameterBuilder as a common interfaces for FormalParameterBuilder
and the new class FunctionTypeParameterBuilder which is used for
parameters in FunctionTypeBuilder.
Change-Id: I5b7fb5a7d0b71547fe1b7a11261a5c783db99caa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239313
Reviewed-by: Jens Johansen <jensj@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-03-31 13:04:34 +00:00
Jens Johansen
6969a6edd3
[parser] Don't leak a rewrite when swallowing an error
...
The old code tries to determine something by using a forwarding listener
without forwarding to anything. It leaked a rewrite though, meaning that
the rewrite stayed, but the error given when rewriting wasn't passed on.
When then parsing it with the real listener, the rewrite was in effect
and there was no error to report. In total no errors were reported.
This fixes the issue by undoing any rewrites in this situation.
Fixes https://github.com/dart-lang/sdk/issues/47020
Change-Id: I5342ae6969f00dea830fb7abb30f21932907b8bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236540
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-03-10 18:43:46 +00:00
Jens Johansen
f40d76d360
[parser] Recover missing () for enum constant with type arguments or dot
...
Fixes https://github.com/dart-lang/sdk/issues/48380
Change-Id: I4f6fd7311c46ad45ccce5bf6b97b40932a457851
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234360
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-03-09 12:40:35 +00:00
Konstantin Shcheglov
9dc81176ab
[parser] Better recovery on empty named argument name
...
Fixes https://github.com/dart-lang/sdk/issues/48288
Change-Id: I831b4870ba7dc69436f68e1ef84e0cdf258073a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234289
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-03-09 09:55:44 +00:00
Johnni Winther
fa05359f2f
[cfe] Support augmentation library imports
...
This adds support for the `import augment <uri>` import syntax when
the 'macros' experiment is enabled.
The CL also include propagation of the augment modifier on class methods
which was missed in a previous CL.
Change-Id: Ic843e7e34559bcac728c810590f34b727b5f7090
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234401
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-02-28 11:42:34 +00:00
Jens Johansen
514f678199
[parser] Better recovery for extra stuff in enum and using enum as identifier
...
Fixes https://github.com/dart-lang/sdk/issues/48371
Change-Id: I93331485c884c89c179c2fa332f3f975db9507f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234043
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-02-25 09:35:25 +00:00
Jens Johansen
cc1366ee73
[parser] Update expect files after commit race between two parser changes
...
The two changes cd41e43c48 and
468f939428 had a "commit race".
Fixes https://github.com/dart-lang/sdk/issues/48464
Change-Id: Iaf72045bafbfc95af018eb187f06dc9d7359dc22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234240
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-02-24 10:42:53 +00:00
Jens Johansen
468f939428
[parser] Better recovery for missing comma in initializer list.
...
Fixes https://github.com/dart-lang/sdk/issues/48411
Change-Id: I5212b15cf9f8749653dbced1c86d0e3e9c163d98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234041
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-02-23 18:12:32 +00:00
Johnni Winther
cd41e43c48
[parser] Support 'augment' as a built-in identifier for augmentation libraries
...
This changes the way the 'augment' modifier is handled in the parser.
Instead of being special cased for class declarations, it is now a
built-in identifier recognized only when the scanner is configured to
support augmentation libraries.
The change supports the used of the 'augment' modifier on not only
class declarations but also mixin and member declarations, as needed
for supporting macros.
Change-Id: I2679d198dea360900cfc478fae9c1660702a8a02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233887
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-02-23 16:17:42 +00:00
Chloe Stefantsova
c12238d3ac
[cfe] Allow typed super parameters
...
Part of https://github.com/dart-lang/sdk/issues/47525
Closes https://github.com/dart-lang/sdk/issues/47741
Closes https://github.com/dart-lang/sdk/issues/48444
Closes https://github.com/dart-lang/sdk/issues/47951
Change-Id: If9aadd996414df5091fc667a7202aafa9a0213db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233889
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com >
2022-02-23 13:10:33 +00:00
Johnni Winther
2435848b13
[parser] Support 'augment' modifier on class declarations
...
This adds support for the 'augment' modifier on class declarations
needed for the static meta-programming prototype.
Change-Id: Iadd11f766a195076405f2803b2092199caf1ea8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233180
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-02-18 09:39:23 +00:00
Jens Johansen
a066e2c83e
[parser] Don't be overly aggressive when parsing 'on' in 'try'
...
Fixes https://github.com/dart-lang/sdk/issues/47541
Change-Id: Idb25f86801b14f75fe7bc06e5496c6fdd2cbe971
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230243
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-01-31 09:09:35 +00:00
Jens Johansen
c2b2aa5b9a
[parser] Add beforeSynthetic to Synthetic*
...
Follow-up to https://dart-review.googlesource.com/c/sdk/+/205799
Change-Id: I620bf4548095d0597b89e4b6305c2301bcbed144
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230242
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-01-28 08:54:13 +00:00