- $data =~ s/([^"]*"[^"]*")\)//s || die "unparsable macro: $data"; # ]]);
- my $ctn = $1;
-
- # cleanup the content
- $ctn =~ s/ *\n//gs;
- $ctn =~ s/,\s*"/,"/gs;
- $ctn =~ s/"\s*$/"/gs;
- $ctn =~ s/,\s*/,/gs;
- my @elms_tmp=split (/,/,$ctn);
- my @elms;
- print "ctn=$ctn\n" if $debug > 1;
- # There may be some ',' in the description. Remerge the stuff like: "description, really"
- while (1) {
- my $acc = shift @elms_tmp;
- last unless defined $acc;
- if ($acc =~ /^"/) { # ") {
- while (shift @elms_tmp) {
- $acc .= $_;
- }
- die "Unparsable content: $ctn\n"
- unless ($acc =~ s/^"(.*)"$/$1/);
- }
- print " seen $acc\n" if $debug > 1;
- push @elms, $acc;
- }
-
- my ($name,$anc,$desc);
+ $data =~ s/([^"]*"[^"]*")\)//s || die "unparsable macro: $data";
+
+ my ($name,$anc,$desc) = cleanup_ctn($1);
+