-
-
Notifications
You must be signed in to change notification settings - Fork 372
/
main-version.in
41 lines (40 loc) · 1.62 KB
/
main-version.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
sub hll-config($config) {
$config<implementation> := 'Rakudo';
$config<version> := '@version@';
$config<release-number> := '@release@';
$config<codename> := '@codename@';
$config<language-version> := '6.@lang_spec@';
# Though language-revisions key provides more information
# can-language-versions is used for speeding up and ordering
# Perl6::Compiler.can_langauge_versions method
$config<can-language-versions>
:= nqp::list( '6.c'@for_specmods(, '6.@spec_with_mod@')@ );
$config<language-revisions> := nqp::hash(
@perl(
# This code is not re-usable, makes no sense to write a dedicated macro
for my $spec ( $cfg->perl6_specs ) {
my $letter = $spec->[0];
my $pfx = " ";
$out .= "$pfx'$letter', nqp::hash(\n";
my $require = '';
my $mods = "$pfx 'mods', nqp::hash(\n";
for my $mod ( @$spec[1..$#$spec] ) {
$mods .= "$pfx '$mod->[0]', nqp::hash(\n";
if ( $mod->[1]{require} ) {
$require = "$pfx 'require', '$mod->[0]',\n";
}
for my $flag ( keys %{$mod->[1]} ) {
$mods .= "$pfx '$flag', " . ($mod->[1]{$flag} ? "1" : "0") . ",\n"
}
$mods .= "$pfx ), # modificator $mod->[0]\n";
}
$mods .= "$pfx ),\n";
$out .= "$require$mods$pfx), # revision $letter\n";
}
)@
);
$config<prefix> := '@prefix@';
$config<nqp-home> := '@nqp_home@';
$config<rakudo-home> := '@rakudo_home@';
$config<source-digest> := '@source_digest()@';
}