On Mon, 17 Sep 2001, Doug MacEachern wrote:
> On Tue, 18 Sep 2001, Stas Bekman wrote:
>
> > +use constant WARN_STYLE_NONE => 0;
> > +use constant WARN_STYLE_PERL => 1;
> > +use constant WARN_STYLE_C => 2;
>
> one thing to consider though, ModPerl::Code has
> noedit_warning_{c,hash} and this comment:
>
> #this is named hash after the `#' character
> #rather than named perl, since #comments are used
> #non-Perl files, e.g. Makefile, typemap, etc.
>
> many of the genfile() calls are generating files that are not Perl code.
> if you look at your patch, there's genfile called for mime.types, *.conf,
> .gdb*, etc. how about this, rather than a style argument to genfile(),
> let genfile figure it out for you based on the file extension.
>
> something like:
>
> my %warnings = (
> html => sub {
> "<!-- @_ -->"
> },
> c => sub {
> "/* @_ */"
> },
> default => sub {
> my $string = join '', @_;
> $string =~ s/^/\#/g;
> $string;
> },
> );
> $warnings{h} = $warnings{c};
OK these are two issues:
1. s/WARN_STYLE_PERL/WARNI_STYLE_HASH/
2. DWIM magic
It's a good idea to let the code decide which comment style to use, but I
won't drop the explicit option yet. So we can probably add the code from
above and remove the WARN_STYLE_ arg in most calls to genfile, but still
keep the explicit option around in case we need it.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]