ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Net-IRC3/scripts/parse_rfc_errors
Revision: 1.1
Committed: Fri Feb 23 20:14:58 2007 UTC (19 years, 6 months ago) by elmex
Branch: MAIN
CVS Tags: HEAD
Log Message:
added some tests and fixed quite some bugs and added missing
documentation.

File Contents

# User Rev Content
1 elmex 1.1 #!/usr/bin/perl
2     use strict;
3     my $in_section = 0;
4     my $in_desc = 0;
5     my %errors;
6     my $cur_error;
7    
8     while (<STDIN>) {
9     if (/^\s+(\d+)\s+((?:ERR|RPL)_\S+)\s*$/) {
10     $cur_error = $1;
11     $errors{$cur_error}->{name} = $2;
12     } elsif (/^\s+"([^:]+):.*"\s*$/) {
13     $errors{$cur_error}->{params} = [ split /\s+/, $1 ];
14     }
15     }
16    
17     print "our %RFC_NUMCODE_MAP = (\n";
18     for (sort keys %errors) {
19     next unless $_ != 0;
20     my $pcnt = 0;
21     printf " '%03d' => '%s',\n",
22     $_, $errors{$_}->{name};
23     }
24     print ");\n";