Skip to content

Commit b13205b

Browse files
committed
Deconfuse language/implementation version.
For those cases where it matters. This will also let us keep the current language version specified in one place.
1 parent 4358ba8 commit b13205b

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/HLL/Compiler.nqp

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -491,18 +491,23 @@ class HLL::Compiler does HLL::Backend::Default {
491491
}
492492

493493
method version() {
494-
my $version := %!config<version>;
495-
my $backver := $!backend.version_string();
496-
my $language := $!language;
497-
if $language eq 'perl6' { # XXX This hardwired info needs to come from somewhere else
498-
nqp::say("This is rakudo version $version built on $backver implementing Perl v6.b.");
499-
}
500-
else {
501-
nqp::say("This is $language version $version built on $backver.");
502-
}
494+
my $version := %!config<version>;
495+
my $backver := $!backend.version_string();
496+
my $implementation := self.implementation();
497+
my $language_name := self.language_name();
498+
if nqp::can(self, 'language_version') {
499+
nqp::say("This is $implementation version $version built on $backver\n" ~
500+
"implementing $language_name " ~ self.language_version() ~ ".");
501+
}
502+
else {
503+
nqp::say("This is $implementation version $version built on $backver");
504+
}
503505
nqp::exit(0);
504506
}
505507

508+
method implementation() { $!language }
509+
method language_name() { $!language }
510+
506511
method show-config() { self.verbose-config(); }
507512

508513
method verbose-config() {

0 commit comments

Comments
 (0)