diff options
Diffstat (limited to 'support/splint/scripts/bindx.pl')
-rwxr-xr-x | support/splint/scripts/bindx.pl | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/support/splint/scripts/bindx.pl b/support/splint/scripts/bindx.pl index beb9719bf8..871612058e 100755 --- a/support/splint/scripts/bindx.pl +++ b/support/splint/scripts/bindx.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Copyright 2012-2020, Alexander Shibakov +# Copyright 2012-2022, Alexander Shibakov # This file is part of SPLinT # # SPLinT is free software: you can redistribute it and/or modify @@ -126,8 +126,8 @@ while (<FILE>) { \{([^\{\}]+)\} # domain \{([0-9]+)\} # rank \{([^\{\}]*)\} # type1 - \{([^\{\}\s]+)\s*\} # type2 - \{((\{[^\{\}]+\})+)\} # key + \{([^\{\}]+)\s*\} # type2 + \{((\{[^\{\}]+\})+|\\vend.*\\vend\s*)\} # key \{((\{[^\{\}]+\})*)\} # visual key (\%.*)*\n/x ) { # ordinary index entry @@ -135,8 +135,19 @@ while (<FILE>) { ($section, $pageno, $nspace, $junk0, $domain, $rank, $type1, $type2, $key, $junk1, $vkey) = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11 ); - $key =~ s/\{([0-9]+)\}/pack "c1", $1/eg; $term = $key; + $key =~ s/\{([0-9]+)\}/pack "c1", $1/eg; + + if ( $term =~ /\\vend/ ) { + + # only process the key if it is not raw + + } else { + + $term = $key; + + } + $vkey =~ s/\{([0-9]+)\}/pack "c1", $1/eg; if ( $vkey ne "" ) { @@ -206,7 +217,16 @@ foreach $domain (sort keys %index ) { $term = $index{$domain}{$key}{term}; $term_printable = $term; - $term =~ s/(.)/"\{".(unpack "c1", $1)."\}"/eg; + + if ( $term =~ /\\vend/ ) { + + $term =~ s/\\vend(.*)\\vend/$1/eg; # unwrap the entry + + } else { + + $term =~ s/(.)/"\{".(unpack "c1", $1)."\}"/eg; + + } if ( alpha_jump( $key, $last_alpha ) > 0 ) { $last_alpha = substr $key, 0, 1; |