Skip to content

Commit

Permalink
#2976. Update assertion texts according to the new spec (#3000)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov authored Nov 28, 2024
1 parent c82e634 commit d50a305
Showing 12 changed files with 62 additions and 51 deletions.
14 changes: 8 additions & 6 deletions LanguageFeatures/Static-access-shorthand/grammar_A01_t01.dart
Original file line number Diff line number Diff line change
@@ -4,15 +4,17 @@

/// @assertion We introduce grammar productions of the form:
/// ```
/// <primary> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// <postfixExpression> ::= ... -- all current productions
/// | <staticMemberShorthand>
///
/// <constantPattern> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// | <staticMemberShorthand>
///
/// <staticMemberShorthand> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// <staticMemberShorthand> ::= <staticMemberShorthandHead> <selector*>
///
/// <staticMemberShorthandHead> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// ```
///
/// @description Checks that static members and constructors of a class can be
14 changes: 8 additions & 6 deletions LanguageFeatures/Static-access-shorthand/grammar_A01_t02.dart
Original file line number Diff line number Diff line change
@@ -4,15 +4,17 @@

/// @assertion We introduce grammar productions of the form:
/// ```
/// <primary> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// <postfixExpression> ::= ... -- all current productions
/// | <staticMemberShorthand>
///
/// <constantPattern> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// | <staticMemberShorthand>
///
/// <staticMemberShorthand> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// <staticMemberShorthand> ::= <staticMemberShorthandHead> <selector*>
///
/// <staticMemberShorthandHead> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// ```
///
/// @description Checks that static members of a mixin can be accessed using the
14 changes: 8 additions & 6 deletions LanguageFeatures/Static-access-shorthand/grammar_A01_t03.dart
Original file line number Diff line number Diff line change
@@ -4,15 +4,17 @@

/// @assertion We introduce grammar productions of the form:
/// ```
/// <primary> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// <postfixExpression> ::= ... -- all current productions
/// | <staticMemberShorthand>
///
/// <constantPattern> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// | <staticMemberShorthand>
///
/// <staticMemberShorthand> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// <staticMemberShorthand> ::= <staticMemberShorthandHead> <selector*>
///
/// <staticMemberShorthandHead> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// ```
///
/// @description Checks that static members and values of an enum can be
14 changes: 8 additions & 6 deletions LanguageFeatures/Static-access-shorthand/grammar_A01_t04.dart
Original file line number Diff line number Diff line change
@@ -4,15 +4,17 @@

/// @assertion We introduce grammar productions of the form:
/// ```
/// <primary> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// <postfixExpression> ::= ... -- all current productions
/// | <staticMemberShorthand>
///
/// <constantPattern> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// | <staticMemberShorthand>
///
/// <staticMemberShorthand> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// <staticMemberShorthand> ::= <staticMemberShorthandHead> <selector*>
///
/// <staticMemberShorthandHead> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// ```
///
/// @description Checks that static members and constructors of an extension
14 changes: 8 additions & 6 deletions LanguageFeatures/Static-access-shorthand/grammar_A02_t01.dart
Original file line number Diff line number Diff line change
@@ -4,15 +4,17 @@

/// @assertion We introduce grammar productions of the form:
/// ```
/// <primary> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// <postfixExpression> ::= ... -- all current productions
/// | <staticMemberShorthand>
///
/// <constantPattern> ::= ... -- all current productions
/// | <staticMemberShorthand>
/// | <staticMemberShorthand>
///
/// <staticMemberShorthand> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// <staticMemberShorthand> ::= <staticMemberShorthandHead> <selector*>
///
/// <staticMemberShorthandHead> ::=
/// '.' (<identifier> | 'new') -- shorthand qualified name
/// | 'const' '.' (<identifier> | 'new') <arguments> -- shorthand object creation
/// ```
///
/// @description Checks that it is a syntax error to use a `new` keyword in the
7 changes: 4 additions & 3 deletions LanguageFeatures/Static-access-shorthand/grammar_A03_t01.dart
Original file line number Diff line number Diff line change
@@ -2,10 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

/// @assertion We also add `.` to the tokens that an expression statement cannot
/// start with.
/// @assertion We also add . to the tokens that an expression statement cannot
/// start with. This doesn't affect starting with a double literal like `.42`,
/// since that's a different token than a single `.`.
///
/// @description Checks that numerical literal like `.123` is still not an error
/// @description Checks that numerical literal like `.42` is still not an error
/// @author [email protected]
// SharedOptions=--enable-experiment=enum-shorthands
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@
/// `.id(args)`, `.id<typeArgs>(args)`, `.new` or `.new(args)`.
/// ...
/// The general rule is that any of the expression forms above, starting with
/// `.id`, are treated exactly as if they were prefixed by a fresh identifier
/// `X` which denotes an accessible type alias for the greatest closure of the
/// context type scheme of the following primary and selector chain.
/// `.id`, are treated exactly as if they were preceded by a fresh prefixed
/// identifier `_p.C` which denotes the declaration of the type of the context
/// type scheme of the entire `<staticMemberShorthand>`.
///
/// @description Checks that the processing of the context type for shorthand
/// of the forms `.id`, `.id(args)` and `.id<typeArgs>(args)` includes a type
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@
/// `.id(args)`, `.id<typeArgs>(args)`, `.new` or `.new(args)`.
/// ...
/// The general rule is that any of the expression forms above, starting with
/// `.id`, are treated exactly as if they were prefixed by a fresh identifier
/// `X` which denotes an accessible type alias for the greatest closure of the
/// context type scheme of the following primary and selector chain.
/// `.id`, are treated exactly as if they were preceded by a fresh prefixed
/// identifier `_p.C` which denotes the declaration of the type of the context
/// type scheme of the entire `<staticMemberShorthand>`.
///
/// @description Checks that the processing of the context type for shorthand
/// of the forms `.id`, `.id(args)` and `.id<typeArgs>(args)` includes a type
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@
/// `.id(args)`, `.id<typeArgs>(args)`, `.new` or `.new(args)`.
/// ...
/// The general rule is that any of the expression forms above, starting with
/// `.id`, are treated exactly as if they were prefixed by a fresh identifier
/// `X` which denotes an accessible type alias for the greatest closure of the
/// context type scheme of the following primary and selector chain.
/// `.id`, are treated exactly as if they were preceded by a fresh prefixed
/// identifier `_p.C` which denotes the declaration of the type of the context
/// type scheme of the entire `<staticMemberShorthand>`.
///
/// @description Checks that the processing of the context type for shorthand
/// of the forms `.id`, `.id(args)` and `.id<typeArgs>(args)` includes a type
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@
/// `.id(args)`, `.id<typeArgs>(args)`, `.new` or `.new(args)`.
/// ...
/// The general rule is that any of the expression forms above, starting with
/// `.id`, are treated exactly as if they were prefixed by a fresh identifier
/// `X` which denotes an accessible type alias for the greatest closure of the
/// context type scheme of the following primary and selector chain.
/// `.id`, are treated exactly as if they were preceded by a fresh prefixed
/// identifier `_p.C` which denotes the declaration of the type of the context
/// type scheme of the entire `<staticMemberShorthand>`.
///
/// @description Checks that the processing of the context type for shorthand
/// of the form `.id<typeArgs>` includes a type alias expansion.
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@
/// `.id(args)`, `.id<typeArgs>(args)`, `.new` or `.new(args)`.
/// ...
/// The general rule is that any of the expression forms above, starting with
/// `.id`, are treated exactly as if they were prefixed by a fresh identifier
/// `X` which denotes an accessible type alias for the greatest closure of the
/// context type scheme of the following primary and selector chain.
/// `.id`, are treated exactly as if they were preceded by a fresh prefixed
/// identifier `_p.C` which denotes the declaration of the type of the context
/// type scheme of the entire `<staticMemberShorthand>`.
///
/// @description Checks that the processing of the context type for shorthand
/// of the form `.id<typeArgs>` includes a type alias expansion. Test unprefixed
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@
/// `.id(args)`, `.id<typeArgs>(args)`, `.new` or `.new(args)`.
/// ...
/// The general rule is that any of the expression forms above, starting with
/// `.id`, are treated exactly as if they were prefixed by a fresh identifier
/// `X` which denotes an accessible type alias for the greatest closure of the
/// context type scheme of the following primary and selector chain.
/// `.id`, are treated exactly as if they were preceded by a fresh prefixed
/// identifier `_p.C` which denotes the declaration of the type of the context
/// type scheme of the entire `<staticMemberShorthand>`.
///
/// @description Checks that the processing of the context type for shorthand
/// of the form `.id<typeArgs>` includes a type alias expansion. Test prefixed

0 comments on commit d50a305

Please sign in to comment.