-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
18 changed files
with
331 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 extend the grammar of part files to allow import, export and | ||
/// part file directives. We allow part files directives to use a configurable | ||
/// URI like the other two. We restrict the part of directive to only allow the | ||
/// string version. | ||
/// | ||
/// -- Changed "<uri>" to "<configurableUri>". | ||
/// <partDirective> ::= <metadata> `part' <configurableUri> `;' | ||
/// | ||
/// -- Removed "<dottedIdentifier>" as option, retaining only "<uri>". | ||
/// <partHeader> ::= <metadata> `part' `of' <uri> `;' | ||
/// | ||
/// -- Added "<importOrExport>* <partDirective>*" | ||
/// <partDeclaration> ::= | ||
/// <partHeader> <importOrExport>* <partDirective>* | ||
/// (<metadata> <topLevelDeclaration>)* <EOF> | ||
/// | ||
/// The grammar change is small, mainly adding import, export and part | ||
/// directives to part files. | ||
/// | ||
/// @description Checks that it is a compile-time error if a part file contains | ||
/// an unnamed library directive. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part 'grammar_A05_t01_lib.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
35 changes: 35 additions & 0 deletions
35
LanguageFeatures/Parts-with-imports/grammar_A05_t01_lib.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 extend the grammar of part files to allow import, export and | ||
/// part file directives. We allow part files directives to use a configurable | ||
/// URI like the other two. We restrict the part of directive to only allow the | ||
/// string version. | ||
/// | ||
/// -- Changed "<uri>" to "<configurableUri>". | ||
/// <partDirective> ::= <metadata> `part' <configurableUri> `;' | ||
/// | ||
/// -- Removed "<dottedIdentifier>" as option, retaining only "<uri>". | ||
/// <partHeader> ::= <metadata> `part' `of' <uri> `;' | ||
/// | ||
/// -- Added "<importOrExport>* <partDirective>*" | ||
/// <partDeclaration> ::= | ||
/// <partHeader> <importOrExport>* <partDirective>* | ||
/// (<metadata> <topLevelDeclaration>)* <EOF> | ||
/// | ||
/// The grammar change is small, mainly adding import, export and part | ||
/// directives to part files. | ||
/// | ||
/// @description Checks that it is a compile-time error if a part file contains | ||
/// an unnamed library directive. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library; | ||
|
||
/**/part of 'grammar_A05_t01.dart'; | ||
// ^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 extend the grammar of part files to allow import, export and | ||
/// part file directives. We allow part files directives to use a configurable | ||
/// URI like the other two. We restrict the part of directive to only allow the | ||
/// string version. | ||
/// | ||
/// -- Changed "<uri>" to "<configurableUri>". | ||
/// <partDirective> ::= <metadata> `part' <configurableUri> `;' | ||
/// | ||
/// -- Removed "<dottedIdentifier>" as option, retaining only "<uri>". | ||
/// <partHeader> ::= <metadata> `part' `of' <uri> `;' | ||
/// | ||
/// -- Added "<importOrExport>* <partDirective>*" | ||
/// <partDeclaration> ::= | ||
/// <partHeader> <importOrExport>* <partDirective>* | ||
/// (<metadata> <topLevelDeclaration>)* <EOF> | ||
/// | ||
/// The grammar change is small, mainly adding import, export and part | ||
/// directives to part files. | ||
/// | ||
/// @description Checks that it is a compile-time error if a part file contains | ||
/// a normal library directive. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library grammar_A05_t02; | ||
part 'grammar_A05_t02_lib.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
32 changes: 32 additions & 0 deletions
32
LanguageFeatures/Parts-with-imports/grammar_A05_t02_lib.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 extend the grammar of part files to allow import, export and | ||
/// part file directives. We allow part files directives to use a configurable | ||
/// URI like the other two. We restrict the part of directive to only allow the | ||
/// string version. | ||
/// | ||
/// -- Changed "<uri>" to "<configurableUri>". | ||
/// <partDirective> ::= <metadata> `part' <configurableUri> `;' | ||
/// | ||
/// -- Removed "<dottedIdentifier>" as option, retaining only "<uri>". | ||
/// <partHeader> ::= <metadata> `part' `of' <uri> `;' | ||
/// | ||
/// -- Added "<importOrExport>* <partDirective>*" | ||
/// <partDeclaration> ::= | ||
/// <partHeader> <importOrExport>* <partDirective>* | ||
/// (<metadata> <topLevelDeclaration>)* <EOF> | ||
/// | ||
/// The grammar change is small, mainly adding import, export and part | ||
/// directives to part files. | ||
/// | ||
/// @description Checks that it is a compile-time error if a part file contains | ||
/// a normal library directive. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
library grammar_A05_t02; | ||
|
||
part of 'grammar_A05_t02.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +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 It’s a compile-time error if a `part` directive denotes a file | ||
/// which is not a part file. | ||
/// @assertion It’s a compile-time error if a part file is a sub-part of itself. | ||
/// That is, if the includes relation has a cycle. | ||
/// | ||
/// @description Check that it is a compile-time error if a `part` directive | ||
/// denotes a file which is not a part file. | ||
/// @description Check that it is a compile-time error if a part file is a | ||
/// sub-part of itself. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=enhanced-parts | ||
|
20 changes: 20 additions & 0 deletions
20
LanguageFeatures/Parts-with-imports/terminology_A05_t01.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `import` directive | ||
/// refers to a Dart file which is not a library. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
import 'terminology_A05_t01_lib1.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
14 changes: 14 additions & 0 deletions
14
LanguageFeatures/Parts-with-imports/terminology_A05_t01_lib1.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `import` refers to | ||
/// an entity which is not a library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part of 'terminology_A05_t01_lib2.dart'; |
14 changes: 14 additions & 0 deletions
14
LanguageFeatures/Parts-with-imports/terminology_A05_t01_lib2.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `import` directive | ||
/// refers to a Dart file which is not a library. | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part 'terminology_A05_t01_lib1.dart'; |
18 changes: 18 additions & 0 deletions
18
LanguageFeatures/Parts-with-imports/terminology_A05_t02.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `import` refers to | ||
/// an entity which is not a library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part 'terminology_A05_t02_lib1.dart'; | ||
part 'terminology_A05_t02_lib2.dart'; | ||
|
||
main() { | ||
} |
14 changes: 14 additions & 0 deletions
14
LanguageFeatures/Parts-with-imports/terminology_A05_t02_lib1.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `import` refers to | ||
/// an entity which is not a library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part of 'terminology_A05_t02.dart'; |
19 changes: 19 additions & 0 deletions
19
LanguageFeatures/Parts-with-imports/terminology_A05_t02_lib2.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `import` refers to | ||
/// an entity which is not a library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part of 'terminology_A05_t02.dart'; | ||
|
||
import 'terminology_A05_t02_lib1.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified |
21 changes: 21 additions & 0 deletions
21
LanguageFeatures/Parts-with-imports/terminology_A05_t03.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `export` refers to | ||
/// an entity which is not a library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part 'terminology_A05_t03_lib.dart'; | ||
export 'terminology_A05_t03_lib.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified | ||
|
||
main() { | ||
} |
14 changes: 14 additions & 0 deletions
14
LanguageFeatures/Parts-with-imports/terminology_A05_t03_lib.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `export` refers to | ||
/// an entity which is not a library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part of 'terminology_A05_t03.dart'; |
18 changes: 18 additions & 0 deletions
18
LanguageFeatures/Parts-with-imports/terminology_A05_t04.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `export` refers to | ||
/// an entity which is not a library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part 'terminology_A05_t04_lib1.dart'; | ||
part 'terminology_A05_t04_lib2.dart'; | ||
|
||
main() { | ||
} |
14 changes: 14 additions & 0 deletions
14
LanguageFeatures/Parts-with-imports/terminology_A05_t04_lib1.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `export` refers to | ||
/// an entity which is not a library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part of 'terminology_A05_t04.dart'; |
19 changes: 19 additions & 0 deletions
19
LanguageFeatures/Parts-with-imports/terminology_A05_t04_lib2.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// 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 A Dart file is either a library file or a part file, each having | ||
/// its own grammar. | ||
/// | ||
/// @description Checks that it is a compile-time error if an `export` refers to | ||
/// an entity which is not a library | ||
/// @author [email protected] | ||
// SharedOptions=--enable-experiment=macros | ||
|
||
part of 'terminology_A05_t04.dart'; | ||
|
||
export 'terminology_A05_t04_lib1.dart'; | ||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
// [analyzer] unspecified | ||
// [cfe] unspecified |