Added support for multiline comments which were required for the
authorJoey Schulze <joey@infodrom.org>
Sat, 2 Nov 2002 09:22:44 +0000 (09:22 +0000)
committerJoey Schulze <joey@infodrom.org>
Sat, 2 Nov 2002 09:22:44 +0000 (09:22 +0000)
general computer oriented acronym list

Styles/fileutils.pl

index 350361f..86a1818 100644 (file)
@@ -15,11 +15,13 @@ sub parse_xmlfile
     my %tmp;
     my $elem;
     my %elm;
+    my $thisentry = '';
+    my $indent = 0;
 
     open (S, "$fname");
     while (<S>) {
-       #next if (/^#/);
-       #next if (/^\s*$/);
+       next if (/^#/);
+       next if (/^\s*$/);
             
        if (/<entity=\"(.*)\"\s+sort=\"(.*)\">/) {
            $entity = $1;
@@ -50,8 +52,14 @@ sub parse_xmlfile
        } elsif (/<\/entry>/) {
            # $list[$#list+1] = \%entry;
            push (@$list, $entry);
-       } elsif (/^\s*(\S+):\s*(.*)$/) {
-           $$entry{$1} = $2;
+       } elsif (/^(\s*)(\S+):\s*(.*)$/) {
+           $thisentry = $2;
+           $indent = length ($1);
+           $$entry{$thisentry} = $3;
+       } elsif (/^(\s*)(.*)$/) {
+           if ($thisentry && length ($1) > $indent) {
+               $$entry{$thisentry} .= " " . $2;
+           }
        }
     }
     close (S);