mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Handle one-liners with '/*:: ... */' upfront
This commit is contained in:
parent
4e8abf55ec
commit
41fe69f86e
@ -21,6 +21,16 @@ my ($found, $start, $first, $gotone, $idpath);
|
||||
$idpath = '';
|
||||
while (<>)
|
||||
{
|
||||
# Match:
|
||||
# IDENT, /*:: ... */
|
||||
# IDENT = value, /*:: ... */
|
||||
# type ident; /*:: ... */
|
||||
if ($_ =~ /^(\s|[^\s=]+)*[\s*]([A-Za-z0-9_]+)(\s+=\s+[^,;]+)?[,;]\s*\/\*::\s*(.*)\s+\*\/$/)
|
||||
{
|
||||
print "\nid:[$idpath$2]::\n\t$4\n";
|
||||
next;
|
||||
}
|
||||
|
||||
if ($found)
|
||||
{
|
||||
if ($_ =~ /^\s+\*\s$/) { next if $first; $_ =~ s/\s\*// if not $first; }
|
||||
@ -41,12 +51,6 @@ while (<>)
|
||||
$_ = "$_\n$dash\n\n";
|
||||
}
|
||||
}
|
||||
elsif ($_ =~ /^(\s|[^\s=]+)*[\s*]([A-Za-z0-9_]+)(\s+=\s+[^,;]+)?[,;]\s*\/\*::\s*(.*)\s+\*\/$/)
|
||||
{
|
||||
print STDOUT "\n" if $gotone;
|
||||
$_ = "\nid:[$idpath$2]::\n\t$4\n";
|
||||
$found = 'sorta'; $gotone = $.;
|
||||
}
|
||||
print STDOUT "\n" and $gotone = undef if $gotone and $gotone < $.;
|
||||
next if not $found; $found = undef if $found eq 'sorta';
|
||||
print STDOUT $_ and $start = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user