Commit Graph

82 Commits

Author SHA1 Message Date
Paul Berry ca78143775 Merge OWNERS_FOUNDATION into OWNERS_LANGUAGE.
These two groups were the same (except for Kallen, who was
accidentally not included in OWNERS_FOUNDATION and should have been),
so we decided to merge them. Internally, the group is called the "Dart
Language and Core Libraries" team, so `OWNERS_LANGUAGE` seems like the
one to keep.

Change-Id: I606ba5828f482c04841c2e995a0066ad6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508166
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2026-06-01 09:59:56 -07:00
Erik Ernst 05ae94dc91 Support static abstract variables and require initializers
This CL adds a grammar rule to Dart.g and Dart.g4 such that a
variable declaration can be `static abstract`. It also changes the rule
for `static final` and `static const` variable declarations such that
it is a syntax error if they do not have an initializing expression.

This restores the approach which was used before augmentations were
added. It is possible to do this because the added flexibility
would only allow cases which are intended to be an error, because it
is no longer possible to "override" or "extend" an implementation
in an augmenting declaration.

Change-Id: Id7696880a948697678eaf368c69c390b9c8f4e7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485440
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-03-04 04:24:07 -08:00
Erik Ernst 92c362a8b0 Align the specification parser with recent specification changes
This CL aligns Dart.g/Dart.g4 with the feature specs for
augmentations and primary constructors such that they allow for all
kinds of membered declaration bodies to be expressed as `;`.

Change-Id: I61fe4b4fe6541fd0962f8ca39590611827c1d127
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483340
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2026-03-04 03:30:23 -08:00
Erik Ernst 2a475cfe9e Align the specification grammar with the specifications
Adjust Dart.g and Dart.g4 to align them with the augmentations feature
specification and the language specification. In particular, the
handling of the keyword AUGMENT is simplified, and `topLevelDefinition`
is renamed.

Change-Id: I99dc5c6e5e3135eae14f49587d60c530e303f0e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476401
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
2026-01-29 02:54:31 -08:00
Erik Ernst 391212f3da Update the specification grammar
The augmentations feature has been modified over a period of time.
This CL introduces the associated grammar changes into the
specification grammars.

Change-Id: Iaa4cdd4c3ffea26ac327265468d68fae59efb2fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2025-12-12 04:53:59 -08:00
Erik Ernst d06e6956e8 Update spec parser rules about primary constructors
This CL changes Dart.g and Dart.g4 such that the spec parser will
parse primary constructors using a simpler and clearer set of rules.
In particular, the body part of a primary constructor has been given
its own signature (`primaryConstructorBodySignature`), which makes it
easier to denote the constructs which are used along with primary
constructors, and it also supports a more comprehensible AST structure.

Change-Id: I7c211ecd76596927a044bdedc5dec3a7eaf9a8b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/460420
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2025-11-10 00:30:12 -08:00
Erik Ernst 5656806517 Update the spec parser to support new();`
This CL changes the spec parser specification (Dart.g and Dart.g4) such
that the grammar allows for the new style of constructor declarations
(such as `new();` and `new name();`). It also adjusts the declaring body
constructor syntax to use the same style (`this();` and `this name();`).
Finally, it updates a few non-terminals to use a naming that avoids the
ambiguity of `classNamePart`. These changes introduce about 5 new
failures when parsing $SDK/tests/language.

Change-Id: I3e6ac9f0782e3bde863a13c93a54a089c93c7e13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456640
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2025-11-03 01:35:25 -08:00
Erik Ernst 149af9d3ae Simplify primary constructor grammar rule
This CL simplifies the grammar rule for a primary constructor and the
place where it's used (`classNamePart`) - the proposal no longer uses
a version that cannot have the modifier `const`. Also, it de-inlines
`typeWithParameters` for consistency and brevity.

Change-Id: Idbd2182a6a29256d61c617c9eb2f631213cb3234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/455400
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2025-10-20 01:31:44 -07:00
Erik Ernst ad5a1bb54f Simplify the grammar to use just memberDeclaration
The spec_parser grammars have previously made a distinction among the
different kinds of members that a class, mixin, extension type, etc
could have. This is not very useful, though, so this CL changes the
grammar such that they all just contain a sequence of general member
declarations `<memberDeclaration>`. It is then up to non-parser based
error checks to prevent whatever should not exist (e.g., until we add
constructors to extensions it is an error to declare a constructor in
an `extension`, but this will be an ad-hoc check rather than a syntax
error).

Change-Id: Ifca2713af86eb3f569732ebef844135b772a5465
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/454280
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2025-10-09 04:11:18 -07:00
Erik Ernst 37c3b5b443 Add support for declaring constructors to the spec parser
Also fixes a bug whereby the file name message came after the first
syntax error diagnostic for each file.

Change-Id: Ice2da1e337fa54787696989b387d057ab5674819
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453280
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-10-03 05:29:00 -07:00
Erik Ernst 57799724ff Eliminate deprecation warning
'SpecParser.java' has always been using an `ANTLRFileStream`, but this
class has been deprecated at this time. Changing the code to use
`CharStreams.fromFileName(...)`.

Change-Id: I35fce3b381ac2e819794c08faef7f97c4c3bea50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444840
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2025-08-12 06:22:15 -07:00
Erik Ernst 0566b169a6 Update Dart.g & Dart.g4 to match newest version of spec
Change-Id: I10a0527577439cb9ea1d94d60b31703995d7f6b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397905
Commit-Queue: Erik Ernst <eernst@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-11-28 12:07:35 +00:00
Erik Ernst bc30907b73 Add support for static access shorthands
Change-Id: I826e230ad38388a8e1f6ccc366704a2e8c340dee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397301
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-11-25 15:28:39 +00:00
Erik Ernst fc7b4dda66 Adjust tests and spec_parser to updated grammar
This CL changes the specification parser grammar to support a switch
expression that has zero cases (this is a missing update, the feature
specification already has it). It also changes several language tests
such that they expect a 'syntax error' rather than a 'compile-time
error'. This makes no difference for any tool except the specification
parser, for which it is needed (in general, a test that is expected
to have a compile-time error will parse just fine, so we need a
separate test outcome expectation for syntax errors).

Change-Id: Ifa00c11ce6c57053bd490e11a41d6e8d7b82a2d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384600
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-09-27 15:29:03 +00:00
Erik Ernst 986626a532 Enable augmentation of additional kinds of declaration
This CL adds support in the grammar for augmenting external top-level
declarations (getter, setter, function, variable). It also adds this
support to several kinds of declarations, and then factors out the
`AUGMENT?` part of each alternative of `declaration` (because we are
now allowing `augment` on every alternative).

This CL is a continuation of
https://dart-review.googlesource.com/c/sdk/+/387160
where the first batch of changes in this area were made.

Change-Id: I7f02709f29d0f13010ac44c4428f90250a38948c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387221
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-09-27 12:29:38 +00:00
Erik Ernst ec891471f5 Add support in Dart.g for separators in numeric literals
Change-Id: I2b0ba97b9b89803b28358b94959e31276eda3af2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387222
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-09-27 12:24:40 +00:00
Erik Ernst 582abe2bbb Add support for omission of implementation as per #4015
This CL adds support in the specification parser (Dart.g) for omitting
the implementation from several kinds of declarations. This is needed
because it must be possible to omit the implementation and provide it
in an augmentation.

The implementation is the initializing expression of a variable, the
function body of a top-lovel or static getter, setter, or method, or
the function body of a factory constructor.

Change-Id: If305dae376ba1c5aabcdd698824aca5d5b0fb97a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387160
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-09-27 07:47:29 +00:00
Erik Ernst 465bbbd720 Update the spec parser to support enhanced parts
Change-Id: I6904294f473d1c9a861ad385e14e17bdd79189d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386560
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-09-25 06:52:42 +00:00
Erik Ernst 812b03da64 Make augment a built-in identifier
This was done in the feature specification in v1.10, but it wasn't
done in the specification parser at the time. This CL corrects that
omission.

Change-Id: I03d54e8f6a369abd5d2be8fb281e8f3abd2cb85d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386240
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-09-24 13:24:02 +00:00
Erik Ernst 00070c74bd Add support for parts with imports in Dart.g
This CL adds support for having import and export directives in a part
file, following the 'parts with imports' feature proposal. It is
needed at this time because tests are being written where some parts
do have imports and exports, and those tests shouldn't give rise to a
parsing failure.

Change-Id: I70076c7b0bd8795a60983306a8b40e7bc55a863b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384282
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-09-10 08:23:19 +00:00
Erik Ernst f019c8188d Update the specification parser to follow language repo #4016
The PR https://github.com/dart-lang/language/pull/4016 updates the
augmentation feature specification such that augmenting extension type
declarations do not specify the primary constructor. This CL changes
Dart.g (and hence the specification parser) accordingly.

It also corrects a typo in Dart.g.

Change-Id: I10b49873a96524a9d363f842b39688f3c624b9f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379100
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-08-07 15:43:29 +00:00
Devon Carew dd5b9cd7d7 [tools/] remove many uses of dynamic in the tools/ directory
Change-Id: I1bd930c11e0463ba0de1938ba417b6664c8cdb28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/376023
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-07-17 15:38:50 +00:00
Devon Carew 4e7a94bdc2 [tools] updating linting in tools/ and reduce use of dynamic
Change-Id: I9e543a384fb10495af4598bfeb12c42944ff614f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375745
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2024-07-15 23:55:30 +00:00
Erik Ernst b56843da32 Spec parse null aware elements
Change-Id: Ib61fea3bec110c0a2c560c965912c51a1c4e22cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368569
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-05-31 09:12:01 +00:00
Erik Ernst 035be2b0d4 Update Dart.g to clarify the association of metadata and its target AST
Change-Id: I02a3e155aab73d638ddbc20485db9db3dcbe6c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365781
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-05-21 09:07:23 +00:00
Erik Ernst a873a14700 Update augmented extensionDeclaration, following PR 3701
Change-Id: I9616ec821ce5eddccd732313f0edc8c300a702b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362200
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-04-11 14:21:28 +00:00
Erik Ernst 555e38db9b Add enumEntry grammar update for augmentations
An `enumEntry` needs to allow for the keyword `augment` in order to
enable augmentation libraries. This CL performs a grammar rule update
in Dart.g and Dart.g4, such that this keyword can be included.

The corresponding change to the feature specification was performed in
https://github.com/dart-lang/language/pull/3688.

Change-Id: I6d6a3f09754a76da668dfc84cd20a7df812ecdbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360642
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-04-03 08:36:38 +00:00
Erik Ernst 50ff1c7823 Introduce support for augmentation libraries in Dart.g
Change-Id: Icc4b89f1b25dd633279d87e9d51f85372d962c7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358450
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2024-03-20 17:10:53 +00:00
Erik Ernst 20f197dacd Include the most recent updates on type modifiers in Dart.g
The class modifiers feature specification was updated such that mixins
cannot be `sealed`, and several other combinations were eliminated.
This CL makes those changes to Dart.g. The changes have been in effect
for a while (8 months since last update to the spec), but the update
to Dart.g was somehow not performed at the time. This CL fixes that
omission.

Change-Id: Ifd2124583a124cdaaa7822f94f70e707ec33b425
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358460
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-03-19 11:44:03 +00:00
Modestas Valauskas e8b20f66b2 Add DSP.
Closes https://github.com/dart-lang/sdk/pull/54781

GitOrigin-RevId: 10439cd7c0da0bc3803cd6f2cfc3133ddb75f087
Change-Id: I6e569b65509dd333daf5c3bb515709f0be03fa89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349408
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-02-06 19:07:13 +00:00
Erik Ernst 270ef81125 Adjust Dart.g such that initializerExpression matches implementation
The specification grammar has a rule for `initializerExpression` that
derives only `cascade` and `conditionalExpression`, whereas the
implementations allow throw expressions and assignments as well.

This CL broadens the grammar rule for `initializerExpression` such
that it derives the missing terms as well.

Change-Id: Iba3bb11623e07ac81cf9763228ae3e1b7b5204e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340620
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-12-08 15:59:09 +00:00
Erik Ernst 5a76c005c6 Correct placement of metadata with named parameters
Bug: #54273
Change-Id: I541456bf052ff44bd210d0e265d4d1d70ca5211e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340560
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-12-08 10:59:28 +00:00
Erik Ernst be64653db1 Add missing import prefix to FUNCTION
This is a commit that should have been part of 340181.

Change-Id: Ic87c9d4975f0b9504395e6bfdac9b3c22fbcddd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340082
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-12-06 13:01:58 +00:00
Erik Ernst f07352b39a Adjust objectPattern to allow Function(toString: '')
Change-Id: Id2bc7e19b9382d941cd0b02ea805e6c0ed462f3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340181
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-12-06 11:16:55 +00:00
Erik Ernst 9a4ca01983 Adjust Dart.g to allow prefix on Function as a type
This CL changes the specification grammar Dart.g such that it allows
using `p.Function` to denote the built-in type `Function`. This is
necessary in the case where 'dart:core' has been imported with an
import prefix `p` (and it hasn't been imported without a prefix at the
same time). The corresponding spec update is in
https://github.com/dart-lang/language/pull/3492.

Change-Id: Iaaba1c3bc8f5d3a8700c8e62ec3a1af92334840b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339561
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-12-05 09:31:49 +00:00
Erik Ernst 5cebb0f980 Adjust Dart.g such that an extension can not have the name type
The declaration `extension type on(int i,) {}` is ambiguous: It can
be an extension named `type` or an extension type named `on`. This
CL adjusts the specification grammar Dart.g such that it is
disambiguated in favor of being an extension type.
See https://github.com/dart-lang/language/issues/3258 for details.

Change-Id: I74f800a75c6c5061675c345c546a85cff046d27f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332243
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-10-27 16:21:41 +00:00
Erik Ernst f15404e908 Correct libraryExport to use configurableUri
Bug: https://github.com/dart-lang/sdk/issues/53214
Change-Id: Idb0756d0c666c8126f5bbb7247b0e40791f28e39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320560
Commit-Queue: Erik Ernst <eernst@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-08-14 16:33:19 +00:00
Erik Ernst 30201181ce Update Dart.g to support extension types, not inline classes
Change-Id: I785eae3d32363db95a3cad00ee3c2c827a5ec9da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319400
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-08-09 11:34:28 +00:00
Erik Ernst ca71bbb0ea Change formal parameter syntax to require "=" (and not ":")
A named optional parameter could previously be equipped with a default
value using ':' or '=' (as in `void f({int i : 1})` or `... i = 1 ...`).
The language has now (Dart 3.0) been updated to eliminate the form
using ':' (it has been deprecated for a long time).

This CL updates the spec_parser accordingly.

Change-Id: I28f9ec605699a9ffb2f7349a6a4b698fa709247b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313482
Commit-Queue: Erik Ernst <eernst@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-07-13 12:41:46 +00:00
Erik Ernst 783abcd4e8 Add suport for inline classes in Dart.g
Change-Id: I63b829e107458268d91b39e7f0abb673dc20d0f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304004
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-05-22 14:09:48 +00:00
Erik Ernst 639a6f06ef Simplify several non-terminals to use regex-like grammar operators
Follow-up to SDK issue #51744.

Change-Id: Ic713ed5adf99bed49f1e93a70817650d5f0c3c46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295545
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-04-17 18:43:31 +00:00
Modestas Valauskas 70762f0de0 [ANTLR] Transform recursive definition of onParts to use iteration ...
Closes https://github.com/dart-lang/sdk/pull/51744

GitOrigin-RevId: 08a3bb98762275f10f6911f59b7cdf5ac1ae6c1d
Change-Id: Ib50f2361ca392554e9c632d7b780f83008bfbef7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288980
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-04-17 17:11:24 +00:00
Modestas Valauskas 337d2cc8b1 [ANTLR] Move optional trailing question mark up.
Closes https://github.com/dart-lang/sdk/pull/51742

GitOrigin-RevId: 8aed1ba4ebbd14aa88a74f4f23464e2c24a10c38
Change-Id: I8184a2edc66acc79c51d3838b0849c4a414784fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288981
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2023-03-17 11:33:59 +00:00
Erik Ernst 4751ed0bb8 Remove unused non-terminal
The non-terminal `patterns` is not used any more. This CL removes the
rule where it is introduced.

Change-Id: I2a8e957957d71999807a0e00fe102e61ed5ec173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288202
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-03-10 11:39:21 +00:00
Modestas Valauskas e0fedb81a1 Replace identifierNotFUNCTION with identifier.
Closes https://github.com/dart-lang/sdk/pull/51675

GitOrigin-RevId: 420ce80ffed652776cc612aaa7209a81df4fe222
Change-Id: I870ffe0d63eb0bbcbfe8f5db6be940c6a470750d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287667
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-03-09 14:50:46 +00:00
Erik Ernst ae408d3706 Add Dart.g support for class modifiers
This CL adds/changes the specification grammar to support the upcoming 'class modifiers' feature. Also, it changes the rule about `superclass` to agree with the language specification (it is easy to see that it derives the same set of programs). Also introduces a non-terminal `otherIdentifier` listing those words which are not reserved, not built-in, but are still explicitly mentioned in grammar (e.g., `show`, `on`, and others). This is safer than maintaining a repeated list of words multiple places in the grammar.

Change-Id: I23dc303f9f9a06a665e19f375fe23378042434c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283183
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-02-15 11:37:57 +00:00
Josh Soref 77978889eb Spelling
Closes https://github.com/dart-lang/sdk/pull/51143

GitOrigin-RevId: 9e21c99a222d588e4fc95980725a2f8c9784965c
Change-Id: If0870e8936c7649935dce7e23cd783d62aa5610c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279916
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-30 18:29:59 +00:00
Erik Ernst d089486bc5 Update Dart.g to support invocations like super<...>(...)
By mistake, the update to the language specification grammar in commit
b26e7287c318c0112610fe8b7e175289792dfde2, May 2021, was not performed
in Dart.g (it's the generalization that allows method invocations of
the form `super(...)` or `super<...>(...)`). This CL adds the needed
alternative to the grammar rule `primary`.

This CL also changes the order of the alternatives in the `primary`
rule such that it matches the ordering of alternatives in the language
specification.

Change-Id: I34092975d1de1e522b0262017686673b7ea7e9e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279092
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-01-17 11:59:58 +00:00
Erik Ernst ebab6fb4de Correct enumEntry, cf. https://github.com/dart-lang/language/pull/2773
Change-Id: Ia2a5565b4162cff9e53bdb699da59cd6d52a04a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279010
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-01-13 16:11:10 +00:00
Erik Ernst 0fcfcc12d7 Several small corrections, based on SDK issue #50982
Bug: 50982
Change-Id: I786ddb49172702f143dfddda2d3ff6ba0d3c6327
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279000
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-01-13 08:56:58 +00:00