-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from fujidaiti/pattern-matching
- Loading branch information
Showing
51 changed files
with
1,355 additions
and
221 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
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 @@ | ||
// ignore_for_file: prefer_typing_uninitialized_variables | ||
|
||
import 'package:embed_annotation/embed_annotation.dart'; | ||
|
||
@EmbedLiteral("/pubspec.yaml") | ||
var pubspec; | ||
|
||
void main() {} |
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,12 @@ | ||
name: example | ||
publish_to: none | ||
|
||
environment: | ||
sdk: ^3.0.5 | ||
|
||
dependencies: | ||
embed_annotation: | ||
path: ../../embed_annotation | ||
|
||
dev_dependencies: | ||
lints: ^2.0.0 |
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 was deleted.
Oops, something went wrong.
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
8 changes: 7 additions & 1 deletion
8
embed/lib/src/embedders/embedder.dart → embed/lib/src/common/embedder.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,10 +1,16 @@ | ||
import 'dart:async'; | ||
import 'dart:io'; | ||
|
||
import 'package:analyzer/dart/element/element.dart'; | ||
import 'package:embed_annotation/embed_annotation.dart'; | ||
|
||
abstract class Embedder<E extends Embed> { | ||
const Embedder(this.config); | ||
|
||
final E config; | ||
FutureOr<String> getEmbeddingOf(File content); | ||
|
||
FutureOr<String> getEmbeddingOf( | ||
File content, | ||
TopLevelVariableElement element, | ||
); | ||
} |
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,17 @@ | ||
class UsageError extends Error { | ||
UsageError(this.message); | ||
final String message; | ||
|
||
@override | ||
String toString() => message; | ||
} | ||
|
||
class ShouldNeverBeHappenError extends Error { | ||
ShouldNeverBeHappenError(); | ||
|
||
@override | ||
String toString() => "This error should never be happen. " | ||
"If you see this message, please report the error with a stacktrace " | ||
"on the GitHub issue page (https://github.com/fujidaiti/embed.dart/issues). " | ||
"It will be very helpful."; | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.