mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
777b182edd
This allowed me to standardize the sourcetar and sf/* scripts: the base directory (containing ./git) is now empty, except for maintenance scripts, while the source files and build scripts of the annotations are stored in a subdirectory of their own.
53 lines
891 B
Perl
Executable file
53 lines
891 B
Perl
Executable file
#!/usr/bin/perl
|
|
|
|
$mark_in = '\\\\begin{verbatim}';
|
|
$mark_out = "\\\\end{verbatim}";
|
|
|
|
sub process_marked
|
|
{
|
|
if ($line =~ /(.*)$mark_in\s*/)
|
|
{
|
|
marked_section();
|
|
}
|
|
else
|
|
{
|
|
print $line;
|
|
}
|
|
}
|
|
|
|
sub marked_section
|
|
{
|
|
@marked = ($line);
|
|
|
|
while ($line = <>)
|
|
{
|
|
push @marked, "$line";
|
|
last if $line =~ /$mark_out/;
|
|
}
|
|
|
|
print $marked[0];
|
|
for ($from = 1; $marked[$from] =~ /^\s*$/; $from++) # $from: at 1st to
|
|
{} # print
|
|
|
|
for ($to = $#marked - 1; $marked[$to] =~ /^\s*$/; $to--)# $to: last to pnt
|
|
{}
|
|
|
|
for ( ; $from <= $to; $from++)
|
|
{
|
|
print $marked[$from];
|
|
}
|
|
|
|
print $marked[$#marked];
|
|
|
|
while ($line = <>)
|
|
{
|
|
last if $line !~ /^\s*$/;
|
|
}
|
|
|
|
process_marked();
|
|
}
|
|
|
|
while ($line = <>)
|
|
{
|
|
process_marked();
|
|
}
|