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>
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>
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>
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>
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>
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>
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>
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>
'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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>