diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 18:33:40 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 18:33:40 -0700 |
commit | 21513e822f64a79dfc651da7e94408d97d985db6 (patch) | |
tree | bc2b4bb51fe3d589ef1815a6d2eca93b18f142dd | |
parent | 2d31ec106a95bf74bb20d145fbd6b266007988c6 (diff) | |
download | nasm-21513e822f64a79dfc651da7e94408d97d985db6.tar.gz nasm-21513e822f64a79dfc651da7e94408d97d985db6.tar.bz2 nasm-21513e822f64a79dfc651da7e94408d97d985db6.zip |
inslist.pl: deal with the new encoding format
Make it possible for inslist.pl to understand the new encoding format;
fix a few minor buglets.
-rw-r--r-- | doc/inslist.pl | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/doc/inslist.pl b/doc/inslist.pl index 8cab04b..7b56038 100644 --- a/doc/inslist.pl +++ b/doc/inslist.pl @@ -35,28 +35,31 @@ $line = 0; $insns = 0; while (<F>) { $line++; - if ( /^\s*;/ ) # comments + next if (/^\s*$/); # blank lines + if ( /^\s*;/ ) # comments { - if ( /^\s*;\#\s*(.+)/ ) # section subheader + if ( /^\s*;\#\s*(.+)/ ) # section subheader { print S "\n\\S{} $1\n\n"; } next; } chomp; - my @entry = split; - next if $#entry == -1; # blank lines - (warn "line $line does not contain four fields\n"), next if $#entry != 3; + unless (/^\s*(\S+)\s+(\S+)\s+(\S+|\[.*\])\s+(\S+)\s*$/) { + warn "line $line does not contain four fields\n"; + next; + } + my @entry = ($1, $2, $3, $4); - @entry[1] =~ s/ignore//; - @entry[1] =~ s/void//; - @entry[3] =~ s/ignore//; - @entry[3] =~ s/,SB//; - @entry[3] =~ s/,SM//; - @entry[3] =~ s/,SM2//; - @entry[3] =~ s/,SQ//; - @entry[3] =~ s/,AR2//; - printf S "\\c %-16s %-24s %s\n",@entry[0],@entry[1],@entry[3]; + $entry[1] =~ s/ignore//; + $entry[1] =~ s/void//; + $entry[3] =~ s/ignore//; + $entry[3] =~ s/,SB//; + $entry[3] =~ s/,SM//; + $entry[3] =~ s/,SM2//; + $entry[3] =~ s/,SQ//; + $entry[3] =~ s/,AR2//; + printf S "\\c %-16s %-24s %s\n",$entry[0],$entry[1],$entry[3]; $insns++; } print S "\n"; |