diff --git a/Language/Errors_and_Warnings/compile_error_lib_p2.dart b/Language/Errors_and_Warnings/compile_error_lib_p2.dart index 90ebea3c47..7426ba34de 100644 --- a/Language/Errors_and_Warnings/compile_error_lib_p2.dart +++ b/Language/Errors_and_Warnings/compile_error_lib_p2.dart @@ -2,8 +2,7 @@ // 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. - -part of compile_error_part_lib; +part of 'compile_error_lib_p1.dart'; int f2() { return 1; diff --git a/Language/Libraries_and_Scripts/Exports/invalid_uri_t03.dart b/Language/Libraries_and_Scripts/Exports/invalid_uri_t03.dart index a8a511be82..f698822556 100644 --- a/Language/Libraries_and_Scripts/Exports/invalid_uri_t03.dart +++ b/Language/Libraries_and_Scripts/Exports/invalid_uri_t03.dart @@ -4,6 +4,7 @@ /// @assertion It is a compile-time error if the specified URI does not refer /// to a library declaration. +/// /// @description Checks that it is a compile-time error when the resource /// specified by the URI refers to a part declaration which is not a library /// declaration @@ -12,8 +13,6 @@ // [error line 1, column 1] // [cfe] unspecified -library my_lib; - export "invalid_uri_t03_part.dart"; // ^ // [analyzer] unspecified diff --git a/Language/Libraries_and_Scripts/Exports/invalid_uri_t03_part.dart b/Language/Libraries_and_Scripts/Exports/invalid_uri_t03_part.dart index cabbfd78ee..19a114a3da 100644 --- a/Language/Libraries_and_Scripts/Exports/invalid_uri_t03_part.dart +++ b/Language/Libraries_and_Scripts/Exports/invalid_uri_t03_part.dart @@ -2,7 +2,14 @@ // 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 is a compile-time error if the specified URI does not refer +/// to a library declaration. +/// +/// @description Checks that it is a compile-time error when the resource +/// specified by the URI refers to a part declaration which is not a library +/// declaration +/// @author ilya -part of my_lib; +part of 'invalid_uri_t03.dart'; var foo = 'foo'; diff --git a/Language/Libraries_and_Scripts/Imports/invalid_uri_t01.dart b/Language/Libraries_and_Scripts/Imports/invalid_uri_t01.dart index 5406b4ca5c..8a2c90cc59 100644 --- a/Language/Libraries_and_Scripts/Imports/invalid_uri_t01.dart +++ b/Language/Libraries_and_Scripts/Imports/invalid_uri_t01.dart @@ -5,6 +5,7 @@ /// @assertion An import specifies a URI x where the declaration of an imported /// library is to be found. It is a compile-time error if the specified URI does /// not refer to a library declaration. +/// /// @description Checks that it is a compile-time error if the URI in an import /// directive refers to a part declaration which is not a library declaration. /// @author ilya @@ -12,8 +13,6 @@ // [error line 1, column 1] // [cfe] unspecified -library my_lib; - import "invalid_uri_t01_part.dart"; // ^ // [analyzer] unspecified diff --git a/Language/Libraries_and_Scripts/Imports/invalid_uri_t01_part.dart b/Language/Libraries_and_Scripts/Imports/invalid_uri_t01_part.dart index cabbfd78ee..7336de8124 100644 --- a/Language/Libraries_and_Scripts/Imports/invalid_uri_t01_part.dart +++ b/Language/Libraries_and_Scripts/Imports/invalid_uri_t01_part.dart @@ -2,7 +2,14 @@ // 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 An import specifies a URI x where the declaration of an imported +/// library is to be found. It is a compile-time error if the specified URI does +/// not refer to a library declaration. +/// +/// @description Checks that it is a compile-time error if the URI in an import +/// directive refers to a part declaration which is not a library declaration. +/// @author ilya -part of my_lib; +part of 'invalid_uri_t01.dart'; var foo = 'foo'; diff --git a/Language/Libraries_and_Scripts/Scripts/library5.dart b/Language/Libraries_and_Scripts/Scripts/library5.dart index 7d31e75012..82ad11ad64 100644 --- a/Language/Libraries_and_Scripts/Scripts/library5.dart +++ b/Language/Libraries_and_Scripts/Scripts/library5.dart @@ -2,8 +2,8 @@ // 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. -part of main_in_a_part; +part of 'top_level_main_t04.dart'; main() { - print('it works'); + print('It works!'); } diff --git a/Language/Libraries_and_Scripts/Scripts/library6.dart b/Language/Libraries_and_Scripts/Scripts/library6.dart index ec8363703b..52101fd2e3 100644 --- a/Language/Libraries_and_Scripts/Scripts/library6.dart +++ b/Language/Libraries_and_Scripts/Scripts/library6.dart @@ -2,6 +2,4 @@ // 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. -part of Library_with_all_directives; - - +part of 'syntax_t11.dart'; diff --git a/Language/Libraries_and_Scripts/Scripts/syntax_t11.dart b/Language/Libraries_and_Scripts/Scripts/syntax_t11.dart index 6632caaca1..67aa9ff0db 100644 --- a/Language/Libraries_and_Scripts/Scripts/syntax_t11.dart +++ b/Language/Libraries_and_Scripts/Scripts/syntax_t11.dart @@ -9,14 +9,10 @@ /// libraryDefinition: /// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* /// ; -/// @description Checks that a script is parsed without errors -/// if all allowed directives are present and in the correct order. +/// @description Checks that a script is parsed without errors if all allowed +/// directives are present and in the correct order. /// @author vasya - - -library Library_with_all_directives; - export "library1.dart"; import 'library1.dart'; diff --git a/Language/Libraries_and_Scripts/URIs/part.dart b/Language/Libraries_and_Scripts/URIs/part.dart deleted file mode 100644 index 474c3c87bf..0000000000 --- a/Language/Libraries_and_Scripts/URIs/part.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) 2011, 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. - -part of SomeLibrary; - -class FooClass {} diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t11.dart b/Language/Libraries_and_Scripts/URIs/syntax_t11.dart index 80af2b7340..ef32fdd82a 100644 --- a/Language/Libraries_and_Scripts/URIs/syntax_t11.dart +++ b/Language/Libraries_and_Scripts/URIs/syntax_t11.dart @@ -8,14 +8,14 @@ /// ; /// It is a compile-time error if the string literal x that describes a URI /// is not a compile-time constant, or if x involves string interpolation. +/// /// @description Checks that it is not an error to use a multi-line string /// literal as a URI in a part directive. /// @author rodionov - -library SomeLibrary; -part """part.dart"""; +import '../../../Utils/expect.dart'; +part """syntax_t11_part.dart"""; main() { - new FooClass(); + Expect.equals("syntax_t11_part.dart", id); } diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t11_part.dart b/Language/Libraries_and_Scripts/URIs/syntax_t11_part.dart new file mode 100644 index 0000000000..ad0aa2daa1 --- /dev/null +++ b/Language/Libraries_and_Scripts/URIs/syntax_t11_part.dart @@ -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 URIs are specified by means of string literals: +/// uri: +/// stringLiteral +/// ; +/// It is a compile-time error if the string literal x that describes a URI +/// is not a compile-time constant, or if x involves string interpolation. +/// +/// @description Checks that it is not an error to use a multi-line string +/// literal as a URI in a part directive. +/// @author sgrekhov22@gmail.com + +part of 'syntax_t11.dart'; + +String id = "syntax_t11_part.dart"; diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t12.dart b/Language/Libraries_and_Scripts/URIs/syntax_t12.dart index d336b08272..662ce46818 100644 --- a/Language/Libraries_and_Scripts/URIs/syntax_t12.dart +++ b/Language/Libraries_and_Scripts/URIs/syntax_t12.dart @@ -8,13 +8,14 @@ /// ; /// It is a compile-time error if the string literal x that describes a URI /// is not a compile-time constant, or if x involves string interpolation. +/// /// @description Checks that it is not an error to use a raw string literal /// as a URI in a part directive. /// @author rodionov -library SomeLibrary; -part r"part.dart"; +import '../../../Utils/expect.dart'; +part r"syntax_t12_part.dart"; main() { - new FooClass(); + Expect.equals("syntax_t12_part.dart", id); } diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t12_part.dart b/Language/Libraries_and_Scripts/URIs/syntax_t12_part.dart new file mode 100644 index 0000000000..e54679139e --- /dev/null +++ b/Language/Libraries_and_Scripts/URIs/syntax_t12_part.dart @@ -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 URIs are specified by means of string literals: +/// uri: +/// stringLiteral +/// ; +/// It is a compile-time error if the string literal x that describes a URI +/// is not a compile-time constant, or if x involves string interpolation. +/// +/// @description Checks that it is not an error to use a raw string literal +/// as a URI in a part directive. +/// @author sgrekhov22@gmail.com + +part of 'syntax_t12.dart'; + +String id = "syntax_t12_part.dart"; diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t13.dart b/Language/Libraries_and_Scripts/URIs/syntax_t13.dart index a8275d9197..2d84aa6649 100644 --- a/Language/Libraries_and_Scripts/URIs/syntax_t13.dart +++ b/Language/Libraries_and_Scripts/URIs/syntax_t13.dart @@ -8,13 +8,14 @@ /// ; /// It is a compile-time error if the string literal x that describes a URI /// is not a compile-time constant, or if x involves string interpolation. +/// /// @description Checks that it is not an error to use a raw string literal /// as a URI in a part directive. /// @author rodionov -library SomeLibrary; -part r'''part.dart'''; +import '../../../Utils/expect.dart'; +part r'''syntax_t13_part.dart'''; main() { - new FooClass(); + Expect.equals("syntax_t13_part.dart", id); } diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t13_part.dart b/Language/Libraries_and_Scripts/URIs/syntax_t13_part.dart new file mode 100644 index 0000000000..8dccc14c43 --- /dev/null +++ b/Language/Libraries_and_Scripts/URIs/syntax_t13_part.dart @@ -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 URIs are specified by means of string literals: +/// uri: +/// stringLiteral +/// ; +/// It is a compile-time error if the string literal x that describes a URI +/// is not a compile-time constant, or if x involves string interpolation. +/// +/// @description Checks that it is not an error to use a raw string literal +/// as a URI in a part directive. +/// @author sgrekhov22@gmail.com + +part of 'syntax_t13.dart'; + +String id = "syntax_t13_part.dart"; diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t14.dart b/Language/Libraries_and_Scripts/URIs/syntax_t14.dart index 4cc784dd74..6848e7ab80 100644 --- a/Language/Libraries_and_Scripts/URIs/syntax_t14.dart +++ b/Language/Libraries_and_Scripts/URIs/syntax_t14.dart @@ -8,13 +8,14 @@ /// ; /// It is a compile-time error if the string literal x that describes a URI /// is not a compile-time constant, or if x involves string interpolation. +/// /// @description Checks that it is not a compile-time error when the URI in a /// part directive consists of two adjacent string literals instead of one. /// @author rodionov -library SomeLibrary; -part "part" ".dart"; +import '../../../Utils/expect.dart'; +part "syntax_t14_part" ".dart"; main() { - new FooClass(); + Expect.equals("syntax_t14_part.dart", id); } diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t14_part.dart b/Language/Libraries_and_Scripts/URIs/syntax_t14_part.dart new file mode 100644 index 0000000000..80c72ca20d --- /dev/null +++ b/Language/Libraries_and_Scripts/URIs/syntax_t14_part.dart @@ -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 URIs are specified by means of string literals: +/// uri: +/// stringLiteral +/// ; +/// It is a compile-time error if the string literal x that describes a URI +/// is not a compile-time constant, or if x involves string interpolation. +/// +/// @description Checks that it is not a compile-time error when the URI in a +/// part directive consists of two adjacent string literals instead of one. +/// @author sgrekhov22@gmail.com + +part of 'syntax_t14.dart'; + +String id = "syntax_t14_part.dart"; diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t15.dart b/Language/Libraries_and_Scripts/URIs/syntax_t15.dart index a6e2732811..c93d65ae3a 100644 --- a/Language/Libraries_and_Scripts/URIs/syntax_t15.dart +++ b/Language/Libraries_and_Scripts/URIs/syntax_t15.dart @@ -8,14 +8,15 @@ /// ; /// It is a compile-time error if the string literal x that describes a URI /// is not a compile-time constant, or if x involves string interpolation. +/// /// @description Checks that it is not a compile-time error when the URI in a /// part directive consists of two adjacent multi-line string literals /// instead of one. /// @author rodionov -library SomeLibrary; -part '''part''' '''.dart'''; +import '../../../Utils/expect.dart'; +part '''syntax_t15_part''' '''.dart'''; main() { - new FooClass(); + Expect.equals("syntax_t15_part.dart", id); } diff --git a/Language/Libraries_and_Scripts/URIs/syntax_t15_part.dart b/Language/Libraries_and_Scripts/URIs/syntax_t15_part.dart new file mode 100644 index 0000000000..d02023cedc --- /dev/null +++ b/Language/Libraries_and_Scripts/URIs/syntax_t15_part.dart @@ -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 URIs are specified by means of string literals: +/// uri: +/// stringLiteral +/// ; +/// It is a compile-time error if the string literal x that describes a URI +/// is not a compile-time constant, or if x involves string interpolation. +/// +/// @description Checks that it is not a compile-time error when the URI in a +/// part directive consists of two adjacent multi-line string literals +/// instead of one. +/// @author sgrekhov22@gmail.com + +part of 'syntax_t15.dart'; + +String id = "syntax_t15_part.dart"; diff --git a/Language/Libraries_and_Scripts/definition_syntax_t04.dart b/Language/Libraries_and_Scripts/definition_syntax_t04.dart index b5d39fcf5d..dd630a102b 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t04.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t04.dart @@ -19,6 +19,7 @@ /// library begins with the word library (possibly prefaced with any applicable /// metadata annotations), followed by a qualified identifier that gives the /// name of the library. +/// /// @description Checks that it is a compile-error if a part directive comes /// before the library name. /// @author rodionov diff --git a/Language/Libraries_and_Scripts/definition_syntax_t04_lib.dart b/Language/Libraries_and_Scripts/definition_syntax_t04_lib.dart index a6d59863ce..048e2d1c41 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t04_lib.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t04_lib.dart @@ -2,6 +2,28 @@ // 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 libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that it is a compile-error if a part directive comes +/// before the library name. +/// @author rodionov + part "definition_syntax_t04_lib_p1.dart"; /**/library Definition_Syntax_t04_lib; diff --git a/Language/Libraries_and_Scripts/definition_syntax_t04_lib_p1.dart b/Language/Libraries_and_Scripts/definition_syntax_t04_lib_p1.dart index 6297d189e2..461256c5b6 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t04_lib_p1.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t04_lib_p1.dart @@ -2,4 +2,26 @@ // 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. -part of Definition_Syntax_t04_lib; +/// @assertion libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that it is a compile-error if a part directive comes +/// before the library name. +/// @author rodionov + +part of 'definition_syntax_t04_lib.dart'; diff --git a/Language/Libraries_and_Scripts/definition_syntax_t07.dart b/Language/Libraries_and_Scripts/definition_syntax_t07.dart index a1d79d4b01..4d3a4725a9 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t07.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t07.dart @@ -19,6 +19,7 @@ /// library begins with the word library (possibly prefaced with any applicable /// metadata annotations), followed by a qualified identifier that gives the /// name of the library. +/// /// @description Checks that it is a compile-error if a part directive /// comes before an import directive. /// @author msyabro diff --git a/Language/Libraries_and_Scripts/definition_syntax_t07_lib.dart b/Language/Libraries_and_Scripts/definition_syntax_t07_lib.dart index 6c80c3724e..525d3ecd9c 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t07_lib.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t07_lib.dart @@ -2,11 +2,30 @@ // 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. - -library Definition_Syntax_t07_lib; +/// @assertion libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that it is a compile-error if a part directive +/// comes before an import directive. +/// @author msyabro part 'definition_syntax_t07_lib_p1.dart'; - import 'definition_syntax_t02_lib.dart'; -//^^^^^^ +/**/import 'definition_syntax_t02_lib.dart'; +// ^^^^^^ // [analyzer] unspecified -// [cfe] unspecified \ No newline at end of file +// [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/definition_syntax_t07_lib_p1.dart b/Language/Libraries_and_Scripts/definition_syntax_t07_lib_p1.dart index 265c29e27f..52c1b97f4f 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t07_lib_p1.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t07_lib_p1.dart @@ -2,5 +2,26 @@ // 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 libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that it is a compile-error if a part directive +/// comes before an import directive. +/// @author msyabro -part of Definition_Syntax_t07_lib; +part of 'definition_syntax_t07_lib.dart'; diff --git a/Language/Libraries_and_Scripts/definition_syntax_t08_lib.dart b/Language/Libraries_and_Scripts/definition_syntax_t08_lib.dart index a8a12d0844..0bae1cd5fb 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t08_lib.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t08_lib.dart @@ -2,12 +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. - library Definition_Syntax_t08_lib; class A {} - import 'definition_syntax_t02_lib.dart'; -//^^^^^^ +/**/import 'definition_syntax_t02_lib.dart'; +// ^^^^^^ // [analyzer] unspecified -// [cfe] unspecified \ No newline at end of file +// [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/definition_syntax_t09.dart b/Language/Libraries_and_Scripts/definition_syntax_t09.dart index ddd9d5e726..8186b5aca3 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t09.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t09.dart @@ -19,6 +19,7 @@ /// library begins with the word library (possibly prefaced with any applicable /// metadata annotations), followed by a qualified identifier that gives the /// name of the library. +/// /// @description Checks that it is a compile-error if a top-level definition /// comes before a part directive. /// @author msyabro diff --git a/Language/Libraries_and_Scripts/definition_syntax_t09_lib.dart b/Language/Libraries_and_Scripts/definition_syntax_t09_lib.dart index 911be1aea2..65b817ae9c 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t09_lib.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t09_lib.dart @@ -2,12 +2,31 @@ // 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. - -library Definition_Syntax_t09_lib; +/// @assertion libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that it is a compile-error if a top-level definition +/// comes before a part directive. +/// @author msyabro class Foo {} - part 'definition_syntax_t09_lib_p1.dart'; -//^^^^ +/**/part 'definition_syntax_t09_lib_p1.dart'; +// ^^^^ // [analyzer] unspecified -// [cfe] unspecified \ No newline at end of file +// [cfe] unspecified diff --git a/Language/Libraries_and_Scripts/definition_syntax_t09_lib_p1.dart b/Language/Libraries_and_Scripts/definition_syntax_t09_lib_p1.dart index 8402bf3315..b2b134a958 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t09_lib_p1.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t09_lib_p1.dart @@ -2,7 +2,28 @@ // 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 libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that it is a compile-error if a top-level definition +/// comes before a part directive. +/// @author msyabro -part of Definition_Syntax_t09_lib; +part of 'definition_syntax_t09_lib.dart'; class Bar {} diff --git a/Language/Libraries_and_Scripts/definition_syntax_t11.dart b/Language/Libraries_and_Scripts/definition_syntax_t11.dart index c3e1eba6e9..93af70ff3a 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t11.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t11.dart @@ -19,11 +19,11 @@ /// library begins with the word library (possibly prefaced with any applicable /// metadata annotations), followed by a qualified identifier that gives the /// name of the library. +/// /// @description Checks that a library is parsed without errors if all allowed /// directives are present in permitted numbers and in the correct order. /// @author msyabro - import "definition_syntax_t11_lib.dart"; main() { diff --git a/Language/Libraries_and_Scripts/definition_syntax_t11_lib.dart b/Language/Libraries_and_Scripts/definition_syntax_t11_lib.dart index 6cff8ed1f5..fa159d7ef8 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t11_lib.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t11_lib.dart @@ -2,6 +2,27 @@ // 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 libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that a library is parsed without errors if all allowed +/// directives are present in permitted numbers and in the correct order. +/// @author msyabro library Library_with_all_directives; diff --git a/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p1.dart b/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p1.dart index 5fb58a2329..0f05a39604 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p1.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p1.dart @@ -2,7 +2,28 @@ // 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 libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that a library is parsed without errors if all allowed +/// directives are present in permitted numbers and in the correct order. +/// @author msyabro -part of Library_with_all_directives; +part of 'definition_syntax_t11_lib.dart'; final int boo1 = 1; diff --git a/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p2.dart b/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p2.dart index cc78696a75..0998b6afad 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p2.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p2.dart @@ -2,7 +2,28 @@ // 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 libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that a library is parsed without errors if all allowed +/// directives are present in permitted numbers and in the correct order. +/// @author msyabro -part of Library_with_all_directives; +part of 'definition_syntax_t11_lib.dart'; final int boo2 = 2; diff --git a/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p3.dart b/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p3.dart index 9439c0bda9..743529844a 100644 --- a/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p3.dart +++ b/Language/Libraries_and_Scripts/definition_syntax_t11_lib_p3.dart @@ -2,7 +2,28 @@ // 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 libraryDefinition: +/// scriptTag? libraryName? importOrExport* partDirective* topLevelDefinition* +/// ; +/// scriptTag: +/// ‘#!’ ( ̃NEWLINE)* NEWLINE +/// ; +/// libraryName: +/// metadata library identifier (‘.’ identifier)* ‘;’ +/// ; +/// importOrExport: +/// libraryImport | +/// libraryExport +/// ; +/// Libraries may be explicitly named or implicitly named. An explicitly named +/// library begins with the word library (possibly prefaced with any applicable +/// metadata annotations), followed by a qualified identifier that gives the +/// name of the library. +/// +/// @description Checks that a library is parsed without errors if all allowed +/// directives are present in permitted numbers and in the correct order. +/// @author msyabro -part of Library_with_all_directives; +part of 'definition_syntax_t11_lib.dart'; final int boo3 = 3; diff --git a/Language/Libraries_and_Scripts/public_namespace_t01.dart b/Language/Libraries_and_Scripts/public_namespace_t01.dart index 8585048108..a72155f66d 100644 --- a/Language/Libraries_and_Scripts/public_namespace_t01.dart +++ b/Language/Libraries_and_Scripts/public_namespace_t01.dart @@ -6,12 +6,12 @@ /// simple name of each public top level member m of L to m. The scope of a /// library L consists of the names introduced by all top level declarations /// declared in L, and the names added by L's imports. +/// /// @description Checks that the scope of a library L consist of the names /// introduced by all top level declaration in L, and the names added by L's /// import. /// @author vasya - import "public_namespace_t01_lib.dart"; main() { diff --git a/Language/Libraries_and_Scripts/public_namespace_t01_lib.dart b/Language/Libraries_and_Scripts/public_namespace_t01_lib.dart index aa1646adc0..243aa98eac 100644 --- a/Language/Libraries_and_Scripts/public_namespace_t01_lib.dart +++ b/Language/Libraries_and_Scripts/public_namespace_t01_lib.dart @@ -2,8 +2,16 @@ // 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 The public namespace of library L is the mapping that maps the +/// simple name of each public top level member m of L to m. The scope of a +/// library L consists of the names introduced by all top level declarations +/// declared in L, and the names added by L's imports. +/// +/// @description Checks that the scope of a library L consist of the names +/// introduced by all top level declaration in L, and the names added by L's +/// import. +/// @author vasya -library Libraries_and_Scripts_A06_t01_lib; import "../../Utils/expect.dart"; part "public_namespace_t01_p1_lib.dart"; diff --git a/Language/Libraries_and_Scripts/public_namespace_t01_p1_lib.dart b/Language/Libraries_and_Scripts/public_namespace_t01_p1_lib.dart index 1b8ea74350..dbf551627f 100644 --- a/Language/Libraries_and_Scripts/public_namespace_t01_p1_lib.dart +++ b/Language/Libraries_and_Scripts/public_namespace_t01_p1_lib.dart @@ -2,8 +2,17 @@ // 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 The public namespace of library L is the mapping that maps the +/// simple name of each public top level member m of L to m. The scope of a +/// library L consists of the names introduced by all top level declarations +/// declared in L, and the names added by L's imports. +/// +/// @description Checks that the scope of a library L consist of the names +/// introduced by all top level declaration in L, and the names added by L's +/// import. +/// @author vasya -part of Libraries_and_Scripts_A06_t01_lib; +part of 'public_namespace_t01_lib.dart'; final L1_variable = 1; diff --git a/Language/Libraries_and_Scripts/public_namespace_t01_p2_lib.dart b/Language/Libraries_and_Scripts/public_namespace_t01_p2_lib.dart index 2be101134b..121d6f0ccc 100644 --- a/Language/Libraries_and_Scripts/public_namespace_t01_p2_lib.dart +++ b/Language/Libraries_and_Scripts/public_namespace_t01_p2_lib.dart @@ -2,8 +2,17 @@ // 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 The public namespace of library L is the mapping that maps the +/// simple name of each public top level member m of L to m. The scope of a +/// library L consists of the names introduced by all top level declarations +/// declared in L, and the names added by L's imports. +/// +/// @description Checks that the scope of a library L consist of the names +/// introduced by all top level declaration in L, and the names added by L's +/// import. +/// @author vasya -part of Libraries_and_Scripts_A06_t01_lib; +part of 'public_namespace_t01_lib.dart'; class L2Class { var field = 2; diff --git a/Language/Metadata/before_part_directive_lib.dart b/Language/Metadata/before_part_directive_lib.dart index aa02f1acc8..339ab6b874 100644 --- a/Language/Metadata/before_part_directive_lib.dart +++ b/Language/Metadata/before_part_directive_lib.dart @@ -2,6 +2,10 @@ // 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 Metadata can appear before ... part directive ... +/// +/// @description Check that metadata is allowed before part directive +/// @author sgrekhov@unipro.ru library before_part_directive_lib; @Deprecated("") @X(42) diff --git a/Language/Metadata/before_part_directive_lib_part.dart b/Language/Metadata/before_part_directive_lib_part.dart index dd89e22e60..c0fc626307 100644 --- a/Language/Metadata/before_part_directive_lib_part.dart +++ b/Language/Metadata/before_part_directive_lib_part.dart @@ -2,8 +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 Metadata can appear before ... part directive ... +/// +/// @description Check that metadata is allowed before part directive +/// @author sgrekhov@unipro.ru -part of before_part_directive_lib; +part of 'before_part_directive_lib.dart'; class A {} - diff --git a/Language/Metadata/before_part_directive_t01.dart b/Language/Metadata/before_part_directive_t01.dart index 20c57c0669..264a095714 100644 --- a/Language/Metadata/before_part_directive_t01.dart +++ b/Language/Metadata/before_part_directive_t01.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion Metadata can appear before ... part directive ... +/// /// @description Check that metadata is allowed before part directive /// @author sgrekhov@unipro.ru diff --git a/Language/Metadata/before_part_header_lib1.dart b/Language/Metadata/before_part_header_lib1.dart index ff9d84690f..6dc7831cbd 100644 --- a/Language/Metadata/before_part_header_lib1.dart +++ b/Language/Metadata/before_part_header_lib1.dart @@ -2,6 +2,10 @@ // 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 Metadata can appear before ... part header ... +/// +/// @description Check that metadata is allowed before part header +/// @author a.semenov@unipro.ru library before_lib2; part 'before_part_header_lib1_p01.dart'; diff --git a/Language/Metadata/before_part_header_lib1_p01.dart b/Language/Metadata/before_part_header_lib1_p01.dart index 8aa0b8d750..4d321d3ae0 100644 --- a/Language/Metadata/before_part_header_lib1_p01.dart +++ b/Language/Metadata/before_part_header_lib1_p01.dart @@ -2,9 +2,13 @@ // 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 Metadata can appear before ... part header ... +/// +/// @description Check that metadata is allowed before part header +/// @author a.semenov@unipro.ru @Deprecated('before_lib2_p01') @A(42) -part of before_lib2; +part of 'before_part_header_lib1.dart'; int i = 0;