-
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
8 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
LanguageFeatures/Unquoted-imports/lib/co19_unquoted_imports.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 We make a breaking change and remove support for the | ||
/// long-deprecated library name syntax from `part of` directives. An unquoted | ||
/// series of identifiers after `part of` then gets unambiguously interpreted as | ||
/// this proposal's semantics. In other words, `part of foo.bar;` is part of the | ||
/// library at `package:foo/bar.dart`, not part of the library with name | ||
/// `foo.bar`. | ||
/// | ||
/// @description Checks that unquoted syntax can be used in `part` and `part of` | ||
/// directives. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=unquoted-imports,enhanced-parts | ||
|
||
part of co19_unquoted_imports/part_A01_t02; | ||
part co19_unquoted_imports/co19_unquoted_imports_part; | ||
|
||
String partId = "co19_unquoted_imports.dart"; |
20 changes: 20 additions & 0 deletions
20
LanguageFeatures/Unquoted-imports/lib/co19_unquoted_imports_part.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 We make a breaking change and remove support for the | ||
/// long-deprecated library name syntax from `part of` directives. An unquoted | ||
/// series of identifiers after `part of` then gets unambiguously interpreted as | ||
/// this proposal's semantics. In other words, `part of foo.bar;` is part of the | ||
/// library at `package:foo/bar.dart`, not part of the library with name | ||
/// `foo.bar`. | ||
/// | ||
/// @description Checks that unquoted syntax can be used in `part` and `part of` | ||
/// directives. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=unquoted-imports,enhanced-parts | ||
|
||
part of co19_unquoted_imports; | ||
|
||
String partId2 = "co19_unquoted_imports_part.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,24 @@ | ||
// 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 make a breaking change and remove support for the | ||
/// long-deprecated library name syntax from `part of` directives. An unquoted | ||
/// series of identifiers after `part of` then gets unambiguously interpreted as | ||
/// this proposal's semantics. In other words, `part of foo.bar;` is part of the | ||
/// library at `package:foo/bar.dart`, not part of the library with name | ||
/// `foo.bar`. | ||
/// | ||
/// @description Checks that unquoted syntax can be used in `part` and `part of` | ||
/// directives. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=unquoted-imports | ||
|
||
part co19_unquoted_imports/part_A01_t01_part; | ||
|
||
main() { | ||
if (partId != "part_A01_t01_part.dart") { // Cannot use expect.dart here | ||
throw "Wrong part '$partId'"; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
LanguageFeatures/Unquoted-imports/lib/part_A01_t01_part.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 We make a breaking change and remove support for the | ||
/// long-deprecated library name syntax from `part of` directives. An unquoted | ||
/// series of identifiers after `part of` then gets unambiguously interpreted as | ||
/// this proposal's semantics. In other words, `part of foo.bar;` is part of the | ||
/// library at `package:foo/bar.dart`, not part of the library with name | ||
/// `foo.bar`. | ||
/// | ||
/// @description Checks that unquoted syntax can be used in `part` and `part of` | ||
/// directives. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=unquoted-imports | ||
|
||
part of co19_unquoted_imports/part_A01_t01; | ||
|
||
String partId = "part_A01_t01_part.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,27 @@ | ||
// 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 make a breaking change and remove support for the | ||
/// long-deprecated library name syntax from `part of` directives. An unquoted | ||
/// series of identifiers after `part of` then gets unambiguously interpreted as | ||
/// this proposal's semantics. In other words, `part of foo.bar;` is part of the | ||
/// library at `package:foo/bar.dart`, not part of the library with name | ||
/// `foo.bar`. | ||
/// | ||
/// @description Checks that unquoted syntax can be used in `part` and `part of` | ||
/// directives. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=unquoted-imports,enhanced-parts | ||
|
||
part co19_unquoted_imports; | ||
|
||
main() { | ||
if (partId != "co19_unquoted_imports.dart") { // Cannot use expect.dart here | ||
throw "Wrong part '$partId'"; | ||
} | ||
if (partId2 != "co19_unquoted_imports_part.dart") { | ||
throw "Wrong part '$partId2'"; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
LanguageFeatures/Unquoted-imports/of.parts.test/lib/part_A02_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,25 @@ | ||
// 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 There are two directives for working with part files, `part` and | ||
/// `part of`. This means that when the parser sees `part of`, it doesn't | ||
/// immediately know if it is looking at a `part` directive followed by an | ||
/// unquoted identifier like `part of`; or `part of.some/other.thing;` versus a | ||
/// `part of` directive like `part of thing;` or `part of 'uri.dart';` It must | ||
/// lookahead past the of identifier to see if the next token is `;`, `.`, `/`, | ||
/// or another identifier. | ||
/// | ||
/// @description Checks that `part of.parts.test` is parsed like a | ||
/// `part 'package:of.parts.test/test.dart';`. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=unquoted-imports | ||
|
||
part of.parts.test; | ||
|
||
main() { | ||
if (partId != "test") { // Cannot use expect.dart here | ||
throw "Wrong part '$partId'"; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
LanguageFeatures/Unquoted-imports/of.parts.test/lib/test.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 There are two directives for working with part files, `part` and | ||
/// `part of`. This means that when the parser sees `part of`, it doesn't | ||
/// immediately know if it is looking at a `part` directive followed by an | ||
/// unquoted identifier like `part of`; or `part of.some/other.thing;` versus a | ||
/// `part of` directive like `part of thing;` or `part of 'uri.dart';` It must | ||
/// lookahead past the of identifier to see if the next token is `;`, `.`, `/`, | ||
/// or another identifier. | ||
/// | ||
/// @description Checks that `part of.parts.test` is parsed like a | ||
/// `part 'package:of.parts.test/test.dart';`. | ||
/// @author sgrekhov22@gmail.com | ||
// SharedOptions=--enable-experiment=unquoted-imports | ||
|
||
part of of.parts.test/part_A02_t01; | ||
|
||
String partId = "test"; |
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,8 @@ | ||
name: of.parts.test | ||
description: Internal package used by co19 tests for Unquoted imports feature | ||
|
||
# This tests isn't intended for publishing on pub.dev. | ||
publish_to: none | ||
|
||
environment: | ||
sdk: '>=3.6.0-255.0.dev' |