On Thursday 05 June 2008 18:19:21 Will Coleda via RT wrote:

> I have a counter-patch:
>
> Index: tools/build/c2str.pl
> =========================================================
> ==========
> --- tools/build/c2str.pl        (revision 28124)
> +++ tools/build/c2str.pl        (working copy)
> @@ -142,10 +142,6 @@
>              die "Seen line $line before in $infile - can't continue";
>          }
>
> -        # RT#46909 maybe cope with escaped \"
> -        my $cnt = tr/"/"/;
> -        die "bogus CONST_STRING at line $line" if $cnt % 2;
> -
>          my $str = extract_delimited;    # $_, '"';
>          $str = substr $str, 1, -1;
>          ## print STDERR "** '$str' $line\n";
>
>
> With this, if a bogus CONST_STRING is constructed, ala:
>
>     STRING *bogus       = CONST_STRING(INTERP, "\\"");
>
> The the build errors out with:
>
> /home/coke/bin/perl tools/build/pmc2c.pl --dump src/pmc/codestring.pmc
> Badly balanced PMC source
>
> No need to duplicate this logic in this build tool when we're already
> checking for it elsewhere.
>
> Comments?

I agree in principle, but the error message from c2str.pl is a lot better than 
the error message from Text::Balanced.  Is that worth the extra code it would 
take to fix this case (which hasn't yet come up)?

-- c

Reply via email to