Index: doc/ChangeLog from Giovanni Palma palma_g@headache
* ref/exdoc.pl: Correct the regexps. * ref/exdoc.config: Add comment style entry.
Index: doc/ref/exdoc.pl --- doc/ref/exdoc.pl Mon, 29 Sep 2003 21:50:01 +0200 astrid (oln/v/26_exdoc.pl 1.1 755) +++ doc/ref/exdoc.pl Mon, 29 Sep 2003 23:01:53 +0200 palma_g (oln/v/26_exdoc.pl 1.1 755) @@ -53,7 +53,7 @@ $config[$entries]{"captions"} = $1 and last SWITCH if (/\s*CAPTIONS\s*=\s*([^#]*[^\s])\s*(#+.*)*$/); $config[$entries]{"out"} = $1 and last SWITCH if (/\s*OUT\s*=\s*([^#]*[^\s])\s*(#+.*)*$/); $config[$entries]{"$1"} = $2 and last SWITCH if (/\s*ALIAS\s*([^\s]*)\s*=\s*([^#]*[^\s])\s*(#+.*)*$/); - + $config[$entries]{"comment_style"} = $1 and last SWITCH if (/\s*COMMENT_STYLE\s*=\s*([^#]*[^\s])\s*(#+.*)*$/); die "$0: Error: Unmatching entry: $_"; } } @@ -111,15 +111,17 @@ # example_to_verbatim(CODE) # ------------------------- # Strip Texinfo markup. -sub example_to_verbatim ($) +sub example_to_verbatim ($ $) { - my ($contents) = @_; + my ($contents, $style) = @_;
$contents =~ s/^@(c |comment|dots|end (ignore|group)|ignore|group).*$//gm; # Remove the Texinfo tags. $contents =~ s/^@(error|result){}//gsm; $contents =~ s/@([{@}])/$1/gsm; $contents =~ s/^@comment.*//gm; + # remove the comment style sequence + $contents =~ s/^$style//gm;
return $contents; } @@ -210,32 +212,30 @@ { my $i = 0;
- print $_; for ($i = 0; ($i < @config) - && not ((/^\s*$config[$i]{"tag_open"}\s*$/ .. /^\s*$config[$i]{"tag_close"}\s*$/)); $i++) + && not ((/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"tag_open"}\s*$/ .. /^\s*$config[$i]{"comment_style"}\s*$config[$i]{"tag_close"}\s*$/)); $i++) { }
if ($i < @config) { - print "PASSEJAMAISLA\n"; - if (/^\s*$config[$i]{"tag_open"}\s*$/) + if (/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"tag_open"}\s*$/) { # Nothing. undef $example; } - elsif (/^\s*$config[$i]{"tag_close"}\s*$/) + elsif (/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"tag_close"}\s*$/) { if (defined $last_file) { # Output as a verbatim file. - store "$odir/$last_file", example_to_verbatim ($example); + store "$odir/$last_file", example_to_verbatim ($example, $config[$i]{"comment_style"}); undef $last_file; } } ## @filecaption{ord, filename} ## Outputting the previous @example as a file. - elsif (/^\s*$config[$i]{"command_prefix"}filecaption{([-.\w]+),\s*([^}]+)}/) + elsif (/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"command_prefix"}filecaption{([-.\w]+),\s*([^}]+)}/) { my ($ord, $file) = ($1, "$2"); register $file; @@ -266,12 +266,9 @@ { my $i = 0; for ($i = 0; ($i < @config) && -# not (/^\s*$config[$i]{"command_prefix"}($config[$i]{"captions"})caption{([-.\w]+),\s*([^}]+)}/); $i++) - not (/^\s*\cxxcaption{([-.\w]+),\s*([^}]+)}/); $i++) + not (/^\s*$config[$i]{"comment_style"}\s*$config[$i]{"command_prefix"}($config[$i]{"captions"})caption{([-.\w]+),\s*([^}]+)}/); $i++) {} -# FIXME: What's wrong with these regexp? -# if ($i < @config && /^\s*$config[$i]{"command_prefix"}($config[$i]{"captions"})caption{([-.\w]+),\s*([^}]+)}/) - if ($i < @config && /^\s*\(cxx)caption{([-.\w]+),\s*([^}]+)}/) + if ($i < @config && /^\s*$config[$i]{"comment_style"}\s*$config[$i]{"command_prefix"}($config[$i]{"captions"})caption{([-.\w]+),\s*([^}]+)}/) { my $prog;
Index: doc/ref/exdoc.config --- doc/ref/exdoc.config Mon, 29 Sep 2003 21:50:01 +0200 astrid (oln/v/28_exdoc.conf 1.1 664) +++ doc/ref/exdoc.config Mon, 29 Sep 2003 22:53:38 +0200 palma_g (oln/v/28_exdoc.conf 1.1 664) @@ -1,7 +1,8 @@ [ENTRY] - COMMAND_PREFIX = \ # In Doxygen, commands begin with a `' + COMMAND_PREFIX = \ # In Doxygen, commands begin with a `' TAG_OPEN = code TAG_CLOSE = endcode CAPTIONS = cxx # We want to run cxx on the extracted files (see line below) ALIAS cxx = g++ # Here, cxx means g++ but you can choose other compilers - OUT = texi # FIXME: should be obsolete + OUT = out # FIXME: should be obsolete + COMMENT_STYLE = ** # begining of comment line \ No newline at end of file