diff options
-rw-r--r-- | fixupdiff.pl | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fixupdiff.pl b/fixupdiff.pl index ce67a42..1a49873 100644 --- a/fixupdiff.pl +++ b/fixupdiff.pl @@ -1,5 +1,19 @@ use strict; +my @protected_labels = ( +'devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Interrupt Suppression', +'devicenormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Notification Suppression', +'devicenormative:General Initialization And Device Operation / Device Operation / Supplying Buffers to The Device / Virtqueue Notification Suppression', +'devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Virtqueue Interrupts From The Device', +'drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Interrupt Suppression', +'drivernormative:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Notification Suppression', +'drivernormative:General Initialization And Device Operation / Device Operation / Supplying Buffers to The Device / Notifying The Device', +'drivernormative:General Initialization And Device Operation / Device Operation / Supplying Buffers to The Device / Updating idx', +'sec:Basic Facilities of a Virtio Device / Virtqueues / Virtqueue Interrupt Suppression', +'sec:General Initialization And Device Operation / Device Operation / Receiving Used Buffers From The Device', +'sec:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Notifying The Device', +'sec:Virtio Transport Options / Virtio Over PCI Bus / PCI-specific Initialization And Device Operation / Virtqueue Interrupts From The Device', +); my $lstlisting=0; while (<>) { @@ -16,6 +30,22 @@ while (<>) { } #print "%FIXED BY RULE 1\n"; } + if ($line =~ m/%DIFDELCMD\s+<\s+\\label\{([^}]*)\}/) { + my $label = $1; + foreach my $l (@protected_labels) { + if ($l eq $label) { + $line =~ s/(%DIFDELCMD\s+<\s+)\\label\{([^}]*)\}/\\label\{$label\}$1/; + } + } + } + if ($line =~ m/%DIFDELCMD\s+<\s+\\((driver|device)normative)\{[^{]*\{[^{]*\{([^}\\]*)\}/) { + my $label = "$1:$3"; + foreach my $l (@protected_labels) { + if ($l eq $label) { + $line =~ s/(%DIFDELCMD\s+<\s+)\\((driver|device)normative)\{[^{]*\{[^{]*\{([^}\\]*)\}/\\label\{$label\}$1/; + } + } + } # Too many \color directives (generated by DIFdel/addbegin/end) # confuse xetex, producing errors: |