-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: IdentifierPart and Identifiers documentation.
- Loading branch information
1 parent
8cbac85
commit 7a74bd7
Showing
9 changed files
with
59 additions
and
57 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
9 changes: 5 additions & 4 deletions
9
..._gen/lib/src/types/macro_identifiers.dart → ...en/lib/src/types/cli_gen_identifiers.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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import '../utils/identifier_part.dart'; | ||
import 'models/identifier_part.dart'; | ||
|
||
class MacroArgIdentifiers { | ||
const MacroArgIdentifiers(); | ||
/// Identifiers for the `cli_annotations` package. | ||
class CliGenIdentifiers { | ||
const CliGenIdentifiers(); | ||
|
||
Uri get _uri => Uri.parse('package:cli_annotations/cli_annotations.dart'); | ||
|
||
IdentifierPart get cliCommand => IdentifierPart('CliCommand', _uri); | ||
|
||
IdentifierPart get cliSubCommand => IdentifierPart('CliSubCommand', _uri); | ||
IdentifierPart get cliSubCommand => IdentifierPart('CliSubcommand', _uri); | ||
|
||
IdentifierPart get cliArgs => IdentifierPart('CliArgs', _uri); | ||
} |
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 |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import 'arg_identifiers.dart'; | ||
import 'cli_gen_identifiers.dart'; | ||
import 'dart_identifiers.dart'; | ||
import 'keyword_identifiers.dart'; | ||
import 'macro_identifiers.dart'; | ||
|
||
/// A collection of common identifiers used for code generation. | ||
class Identifiers { | ||
const Identifiers._(); | ||
|
||
static const args = ArgsIdentifiers(); | ||
|
||
static const keywords = KeywordIdentifiers(); | ||
|
||
static const dart = DartCoreIdentifiers(); | ||
|
||
static const macro = MacroArgIdentifiers(); | ||
static const cliGen = CliGenIdentifiers(); | ||
} |
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...li_gen/lib/src/utils/identifier_part.dart → ...lib/src/types/models/identifier_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
38 changes: 38 additions & 0 deletions
38
src/cli_gen/lib/src/types/models/macro_identifier_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,38 @@ | ||
// // ignore: implementation_imports, depend_on_referenced_packages | ||
// import 'package:_fe_analyzer_shared/src/macros/api.dart'; | ||
|
||
// import 'identifier_part.dart'; | ||
|
||
// /// A reference to a Macro identifier. | ||
// class MacroIdentifierPart extends IdentifierPart { | ||
// MacroIdentifierPart( | ||
// this.identifier, | ||
// Uri uri, | ||
// ) : super(identifier.name, uri); | ||
|
||
// final Identifier identifier; | ||
|
||
// @override | ||
// String get name => identifier.name; | ||
|
||
// @override | ||
// String toCodeString() => name; | ||
|
||
// @override | ||
// String toString() { | ||
// return 'MacroIdentifier{name: $name, uri: $uri}'; | ||
// } | ||
|
||
// @override | ||
// int get hashCode => name.hashCode ^ uri.hashCode ^ identifier.hashCode; | ||
|
||
// @override | ||
// bool operator ==(Object other) { | ||
// if (identical(this, other)) return true; | ||
|
||
// return other is MacroIdentifierPart && | ||
// other.name == name && | ||
// other.uri == uri && | ||
// other.identifier == identifier; | ||
// } | ||
// } |
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,4 @@ | ||
export 'arg_identifiers.dart'; | ||
export 'cli_gen_identifiers.dart'; | ||
export 'dart_identifiers.dart'; | ||
export 'identifiers.dart'; |
38 changes: 0 additions & 38 deletions
38
src/cli_gen/lib/src/utils/identifiers/macro_identifier_part.dart
This file was deleted.
Oops, something went wrong.