Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 9b37b818f4
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (33 sloc) 0.888 kB
#!/usr/bin/perl
# Copyright (C) 2008, The Perl Foundation.
# $Id$
use strict;
use warnings;
my @files = @ARGV;
print <<"END_SETTING";
# This file automatically generated by $0.
no Main;
END_SETTING
foreach my $file (@files) {
print "# From $file\n\n";
open(my $fh, "< $file") or die $!;
print join('', <$fh>);
close $fh;
}
my @classes = ('Any');
foreach my $file (@files) {
next unless $file =~ /setting((?:[\/\\]\w+)+)\.pm$/;
my $full_modname = substr($1, 1);
push @classes, $full_modname;
}
print <<"END_SETTING";
# Need to import all built-in classes and set \%*INC for each.
sub SETTING_INIT() {
END_SETTING
s/\\/\//g for @classes;
print join('', map {
my $colon_form = $_;
$colon_form =~ s/[\/\\]/::/g;
" \%*INC<$_> = 1;\n Perl6::Compiler.import('$colon_form', ':DEFAULT', ':MANDATORY');\n"
} @classes);
print "}\n";
Jump to Line
Something went wrong with that request. Please try again.