Front page | perl.perl5.porters |
Postings from January 2004
Re: [perl #24774] eval + format - \n = pp_ctl.c assertion
Thread Previous
From:
H.Merijn Brand
Date:
January 2, 2004 03:18
Subject:
Re: [perl #24774] eval + format - \n = pp_ctl.c assertion
Message ID:
20040102121752.8F88.H.M.BRAND@hccnet.nl
On Fri 02 Jan 2004 11:31, LAUN Wolfgang <wolfgang.laun@alcatel.at> wrote:
> On Tue, 30 Dec 2003 15:30:37 +0000 davem@fdisolutions.com wrote:
> > On Tue, Dec 30, 2003 at 01:26:59AM -0000, rob@exitexchange.com (via RT) wrote:
> > > created a format with eval, that does NOT include a trailing \n,
> > > gives the following error when write() is called:
> > >
> > > Assertion fpc <= fops + maxops failed: file "pp_ctl.c", line 3731 at (eval 1) line 5.
> >
> > Ah, mea cupla!
> >
> > Fixed by patch #22005
> > (Nick, this is a good candidate for 5.8.3)
>
> Festina lente ;-)
>
> Yes, it fixes the assertion failure and all that may come from an
> insufficient allocation. But note that the eval does not return an
> error, so the format can be run. Observe:
Wolfgang, can I please have your comments on this:
On Mon 27 Oct 2003 19:36, "H.Merijn Brand" <h.m.brand@hccnet.nl> wrote:
> The last paragraph of perlform sais
>
> --8<---
> Inside of an expression, the whitespace characters \n, \t and \f are
> considered to be equivalent to a single space. Thus, you could think
> of this filter being applied to each value in the format:
>
> $value =~ tr/\n\t\f/ /;
>
> The remaining whitespace character, \r, forces the printing of a new
> line if allowed by the picture line.
> -->8---
>
> I know nobody cares, but why is \e treated as whitespace? It's not in these
> docs, and I cannot think of a valid reason to strip escapes, other than ...
> way back when we had paper terminals ...
>
> l1:/pro/3gl/CPAN/perl-current 157 > perl5.8.0 -MO=Deparse merijn/fmt.pl
> $_ = "\eE";
> format STDOUT =
> @<<<<<<<<<<<<<<
> $_
> .
> write;
> merijn/fmt.pl syntax OK
> l1:/pro/3gl/CPAN/perl-current 158 > perl5.8.0 -MO=Concise merijn/fmt.pl
> e <@> leave[t1] vKP/REFC ->(end)
> 7 <0> enter ->8
> 8 <;> nextstate(main 1 fmt.pl:3) v ->9
> b <2> sassign vKS/2 ->c
> 9 <$> const(PV "\033E") s ->a
> - <1> ex-rv2sv sKRM*/1 ->b
> a <$> gvsv(*_) s ->b
> c <;> nextstate(main 2 fmt.pl:10) v ->d
> d <0> enterwrite v ->e
> merijn/fmt.pl syntax OK
> l1:/pro/3gl/CPAN/perl-current 159 > perl5.8.0 -MO=Terse merijn/fmt.pl
> LISTOP (0x4001e170) leave [1]
> OP (0x4002d650) enter
> COP (0x4001e128) nextstate
> BINOP (0x4001e0f8) sassign
> SVOP (0x4001e088) const PV (0x4001a428) "\033E"
> UNOP (0x4001e058) null [15]
> SVOP (0x4001e028) gvsv GV (0x4001a314) *_
> COP (0x4002d608) nextstate
> OP (0x4002d5e0) enterwrite
> merijn/fmt.pl syntax OK
> l1:/pro/3gl/CPAN/perl-current 160 > perl5.8.0 merijn/fmt.pl | cat -ve
> E$
> l1:/pro/3gl/CPAN/perl-current 161 >
>
> enterwrite calls S_doprint which calls CvSTART where I'm lost
> I don't see the point (yet) where the \n\r\t\e are tr'd to space
--
H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.0, & 5.9.x, and 806 on HP-UX 10.20 & 11.00, 11i,
AIX 4.3, SuSE 8.2, and Win2k. http://www.cmve.net/~merijn/
http://archives.develooper.com/daily-build@perl.org/ perl-qa@perl.org
send smoke reports to: smokers-reports@perl.org, QA: http://qa.perl.org
Thread Previous