examples: shorten the name of the calc++ files

* doc/bison.texi: Turn the calc++- prefix into calc++/.
* examples/extexi (%file_wanted): Replace with
(&file_wanted): this.
* examples/calc++/local.mk: Adjust.
This commit is contained in:
Akim Demaille
2018-08-23 08:42:00 +02:00
parent 9645a2b20e
commit 3fda8335bf
5 changed files with 85 additions and 81 deletions

View File

@@ -65,8 +65,21 @@ sub message($)
}
}
# basename => full file name for files we should extract.
my %file_wanted;
# The list of files we should extract.
my @file_wanted;
# Whether we should extract that file, and then under which path.
sub file_wanted ($)
{
my ($f) = @_;
for my $file (@file_wanted)
{
# No endswith in Perl 5...
return $file if $f eq substr($file, -length($f));
}
undef
}
sub process ($)
{
@@ -89,9 +102,9 @@ sub process ($)
{
my $f = $1;
$block = $2 || 1;
if ($file_wanted{$f})
if (file_wanted($f))
{
$file = $file_wanted{$f};
$file = file_wanted($f);
message(" GEN $file");
}
else
@@ -142,8 +155,7 @@ for my $arg (@ARGV)
{
if ($seen_dash)
{
use File::Basename;
$file_wanted{basename($arg)} = $arg;
push @file_wanted, $arg;
}
elsif ($arg eq '--')
{