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
Properly implement $*PERL according to spec
This introduces the Perl and Compiler classes
- Loading branch information
Showing
7 changed files
with
82 additions
and
18 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| class Compiler does Systemic { | ||
| has Str $!release; | ||
| has DateTime $!build-date; | ||
| has Str $!codename; | ||
|
|
||
| submethod BUILD ( | ||
| :$!name = 'rakudo', | ||
| :$!auth = 'unknown', | ||
| :$version, | ||
| :$!signature = Blob, | ||
| :$!desc = "", | ||
| :$release, | ||
| :$build-date, | ||
| :$codename, | ||
| ) { | ||
| # XXX Various issues with this stuff on JVM | ||
| my Mu $compiler := nqp::getcurhllsym('$COMPILER_CONFIG'); | ||
| $!version = Version.new( | ||
| $version // nqp::p6box_s(nqp::atkey($compiler, 'version')) ); | ||
| $!release = | ||
| $release // nqp::p6box_s(nqp::atkey($compiler, 'release-number')); | ||
| $!build-date = DateTime.new( | ||
| $build-date // nqp::p6box_s(nqp::atkey($compiler, 'build-date')) ); | ||
| $!codename = | ||
| $codename // nqp::p6box_s(nqp::atkey($compiler, 'codename')); | ||
| } | ||
| } | ||
|
|
||
| multi postcircumfix:<{ }> (Compiler $d, "name" ) { | ||
| DEPRECATED('$*PERL.compiler.name', :what('$*PERL<compiler><name>') ); | ||
| $d.name | ||
| } | ||
| multi postcircumfix:<{ }> (Compiler $d, "ver" ) { | ||
| DEPRECATED('$*PERL.compiler.version', :what('$*PERL<compiler><ver>') ); | ||
| $d.version | ||
| } | ||
| multi postcircumfix:<{ }> (Compiler $d, "release-number" ) { | ||
| DEPRECATED('$*PERL.compiler.release', :what('$*PERL<compiler><release-number') ); | ||
| $d.release | ||
| } | ||
| multi postcircumfix:<{ }> (Compiler $d, "build-date" ) { | ||
| DEPRECATED('$*PERL.compiler.build-date', :what('$*PERL<compiler><build-date>') ); | ||
| $d.build-date | ||
| } | ||
| multi postcircumfix:<{ }> (Compiler $d, "codename" ) { | ||
| DEPRECATED('$*PERL.compiler.codename', :what('$*PERL<compiler><codename>') ); | ||
| $d.build-date | ||
| } |
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,22 @@ | ||
| class Perl does Systemic { | ||
| has Compiler $.compiler; | ||
|
|
||
| submethod BUILD ( | ||
| :$!name = 'Perl 6', | ||
| :$!auth = "unknown", | ||
| :$!version = Version.new("unknown"), | ||
| :$!signature = Blob, | ||
| :$!desc = "", | ||
| :$!compiler = Compiler.new, | ||
| ) { } | ||
| } | ||
| PROCESS::<$PERL> := Perl.new; | ||
|
|
||
| multi postcircumfix:<{ }> (Perl $d, "name" ) { | ||
| DEPRECATED('$*PERL.name', :what('$*PERL<name>') ); | ||
| $d.name | ||
| } | ||
| multi postcircumfix:<{ }> (Perl $d, "compiler" ) { | ||
| # allow this silently, as we will catch it on accessing the Compiler object | ||
| $d.compiler | ||
| } |
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
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
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