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
Some bits of CompUnit::PrecompilationStore
- Loading branch information
Showing
5 changed files
with
65 additions
and
0 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,28 @@ | ||
| subset CompUnit::PrecompilationId of Str:D | ||
| where { 2 < .chars < 64 && $_ ~~ /^<[A..Za..z0..9_]>+$/ }; | ||
|
|
||
| role CompUnit::PrecompilationStore { | ||
| # Load the precompilation identified by the pairing of the specified | ||
| # compiler and precompilation ID. | ||
| method load(CompUnit::PrecompilationId $compiler-id, | ||
| CompUnit::PrecompilationId $precomp-id) | ||
| { ... } | ||
|
|
||
| # Store the file at the specified path in the precompilation store, | ||
| # under the given compiler ID and precompilation ID. | ||
| method store(CompUnit::PrecompilationId $compiler-id, | ||
| CompUnit::PrecompilationId $precomp-id, | ||
| Str:D $path) | ||
| { ... } | ||
|
|
||
| # Delete an individual precompilation. | ||
| method delete(CompUnit::PrecompilationId $compiler-id, | ||
| CompUnit::PrecompilationId $precomp-id) | ||
| { ... } | ||
|
|
||
| # Delete all precompilations for a particular compiler. | ||
| method delete-by-compiler(CompUnit::PrecompilationId $compiler-id) | ||
| { ... } | ||
| } | ||
|
|
||
| # vim: ft=perl6 expandtab sw=4 |
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,29 @@ | ||
| class CompUnit::PrecompilationStore::File does CompUnit::PrecompilationStore { | ||
| has Str $.prefix is required; | ||
|
|
||
| method load(CompUnit::PrecompilationId $compiler-id, | ||
| CompUnit::PrecompilationId $precomp-id) | ||
| { | ||
| } | ||
|
|
||
| method store(CompUnit::PrecompilationId $compiler-id, | ||
| CompUnit::PrecompilationId $precomp-id, | ||
| Str:D $path) | ||
| { | ||
| my $dest = self.prefix.IO | ||
| .child($compiler-id.IO) | ||
| .child($precomp-id.substr(0, 2).IO); | ||
| $dest.mkdir; | ||
| $path.IO.copy($dest.child($precomp-id.IO)); | ||
| } | ||
|
|
||
| method delete(CompUnit::PrecompilationId $compiler-id, CompUnit::PrecompilationId $precomp-id) | ||
| { | ||
| } | ||
|
|
||
| method delete-by-compiler(CompUnit::PrecompilationId $compiler-id) | ||
| { | ||
| } | ||
| } | ||
|
|
||
| # vim: ft=perl6 expandtab sw=4 |
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