Message from discussion
error with Delayed
Received: by 10.100.234.18 with SMTP id g18mr675762anh.22.1273107450893;
Wed, 05 May 2010 17:57:30 -0700 (PDT)
X-BeenThere: lepl@googlegroups.com
Received: by 10.101.149.35 with SMTP id b35ls3049068ano.5.p; Wed, 05 May 2010
17:57:30 -0700 (PDT)
Received: by 10.100.236.30 with SMTP id j30mr5411202anh.45.1273107450450;
Wed, 05 May 2010 17:57:30 -0700 (PDT)
Received: by 10.100.236.30 with SMTP id j30mr5411199anh.45.1273107450195;
Wed, 05 May 2010 17:57:30 -0700 (PDT)
Return-Path: <tazg2...@gmail.com>
Received: from mail-gy0-f186.google.com (mail-gy0-f186.google.com [209.85.160.186])
by gmr-mx.google.com with ESMTP id 19si28457yxe.11.2010.05.05.17.57.30;
Wed, 05 May 2010 17:57:30 -0700 (PDT)
Received-SPF: pass (google.com: domain of tazg2...@gmail.com designates 209.85.160.186 as permitted sender) client-ip=209.85.160.186;
Received: by gyf3 with SMTP id 3so5485054gyf.23
for <lepl@googlegroups.com>; Wed, 05 May 2010 17:57:30 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.150.234.2 with SMTP id g2mr1322358ybh.73.1273107450026; Wed,
05 May 2010 17:57:30 -0700 (PDT)
Received: by q32g2000yqb.googlegroups.com with HTTP; Wed, 5 May 2010 17:57:29
-0700 (PDT)
Date: Wed, 5 May 2010 17:57:29 -0700 (PDT)
In-Reply-To: <b86d3540-f7b4-477d-8e2e-162b735b1347@o14g2000yqb.googlegroups.com>
X-IP: 99.251.201.81
References: <3707939c-e196-4ceb-b693-94e37ee8939e@d39g2000yqa.googlegroups.com>
<c55c92a8-2f5c-4f42-a758-d0840e268aa4@b18g2000yqb.googlegroups.com>
<76dad6d1-a708-4a98-a2df-0a1e279daf89@e1g2000yqe.googlegroups.com>
<b86d3540-f7b4-477d-8e2e-162b735b1347@o14g2000yqb.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3)
Gecko/20100401 Firefox/3.6.3,gzip(gfe)
Message-ID: <b72f33e4-746a-4280-b2ef-2df3842628b7@q32g2000yqb.googlegroups.com>
Subject: [LEPL] Re: error with Delayed
From: jazg <tazg2...@gmail.com>
To: lepl <lepl@googlegroups.com>
X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com:
domain of tazg2...@gmail.com designates 209.85.160.186 as permitted sender)
smtp.mail=tazg2...@gmail.com
X-Original-Sender: tazg2...@gmail.com
Reply-To: lepl@googlegroups.com
Precedence: list
Mailing-list: list lepl@googlegroups.com; contact lepl+owners@googlegroups.com
List-ID: <lepl.googlegroups.com>
List-Post: <http://groups.google.com/group/lepl/post?hl=en_US>,
<mailto:lepl@googlegroups.com>
List-Help: <http://groups.google.com/support/?hl=en_US>, <mailto:lepl+help@googlegroups.com>
List-Archive: <http://groups.google.com/group/lepl?hl=en_US>
Sender: lepl@googlegroups.com
List-Subscribe: <http://groups.google.com/group/lepl/subscribe?hl=en_US>,
<mailto:lepl+subscribe@googlegroups.com>
List-Unsubscribe: <http://groups.google.com/group/lepl/subscribe?hl=en_US>,
<mailto:lepl+unsubscribe@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Both of those (using a function and upgrading) fixed the problem for
me.
On May 5, 8:38=A0pm, andrew cooke <and...@acooke.org> wrote:
> Thanks (and thanks for the nice simple test case).
>
> OK, so my initial attempts to reproduce this on 4.2.1 failed. =A0If you
> used easy_install, then
>
> =A0 easy_install -U lepl
>
> should update you to that.
>
> What's happening is that the internal representation used while
> rewriting a parser to a regular expression is "escaping". =A0My guess is
> that it didn't show up in tests for that release because once a parser
> is "complex enough", the rewriting is no longer possible and the
> internal representation is converted into a matcher.
>
> So a work around would be to force that (make the parser "complex
> enough") and the simplest way to do that is to add a function. =A0The
> following change (which basically does nothing, but calls the 'list'
> function/constructor to do it) might avoid the problem (if you have
> the time I'd be interested to know if it does):
>
> =A0 =A0 =A0 =A0 c =3D Delayed()
>
> =A0 =A0 =A0 =A0 a =3D Literal("a") + c
> =A0 =A0 =A0 =A0 b =3D Literal("b")
> =A0 =A0 =A0 =A0 c +=3D (a | b) >=3D list
>
> Anyway, I'll continue looking at this to make sure it really is fixed
> now (I don't understand what has changed to fix this in 4.2.1 - it may
> be a platform thing as I am using Linux). =A0if either of the above
> don't help, please say...
>
> Cheers,
> Andrew
>
> On May 5, 8:27=A0pm, jazg <tazg2...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > lepl 4.1, same error in python 2.7 and 3.1, windows xp
>
> > On May 5, 8:17=A0pm, andrew cooke <and...@acooke.org> wrote:
>
> > > Whoa. =A0Yes, that is very much a bug. =A0Do you know what version of=
Lepl
> > > you have installed? =A0Also, it might be useful to know what Python
> > > version and OS (but to be honest it's such a bad bug I suspect it's
> > > going to be easy to reproduce). =A0I'll look at it now (need to switc=
h
> > > computers...) and get back to you with a fix or work-around ASAP.
>
> > > Thanks,
> > > Andrew
>
> > > On May 3, 3:48=A0am, jazg <tazg2...@gmail.com> wrote:
>
> > > > Here's the problem as simplified as possible:
>
> > > > c =3D Delayed()
>
> > > > a =3D Literal("a") + c
> > > > b =3D Literal("b")
> > > > c +=3D a | b
>
> > > > print c.parse("ab")
>
> > > > The error is:
> > > > lepl\matchers\core.py", line 215, in _match
> > > > AttributeError: 'RegexpContainer' object has no attribute '_match'
>
> > > > Is that a bug or am I doing something wrong? What can be done about=
it?
>
> > > > --
> > > > You received this message because you are subscribed to the Google =
Groups "lepl" group.
> > > > To post to this group, send email to lepl@googlegroups.com.
> > > > To unsubscribe from this group, send email to lepl+unsubscribe@goog=
legroups.com.
> > > > For more options, visit this group athttp://groups.google.com/group=
/lepl?hl=3Den.
>
> > > --
> > > You received this message because you are subscribed to the Google Gr=
oups "lepl" group.
> > > To post to this group, send email to lepl@googlegroups.com.
> > > To unsubscribe from this group, send email to lepl+unsubscribe@google=
groups.com.
> > > For more options, visit this group athttp://groups.google.com/group/l=
epl?hl=3Den.
>
> > --
> > You received this message because you are subscribed to the Google Grou=
ps "lepl" group.
> > To post to this group, send email to lepl@googlegroups.com.
> > To unsubscribe from this group, send email to lepl+unsubscribe@googlegr=
oups.com.
> > For more options, visit this group athttp://groups.google.com/group/lep=
l?hl=3Den.
>
> --
> You received this message because you are subscribed to the Google Groups=
"lepl" group.
> To post to this group, send email to lepl@googlegroups.com.
> To unsubscribe from this group, send email to lepl+unsubscribe@googlegrou=
ps.com.
> For more options, visit this group athttp://groups.google.com/group/lepl?=
hl=3Den.
--=20
You received this message because you are subscribed to the Google Groups "=
lepl" group.
To post to this group, send email to lepl@googlegroups.com.
To unsubscribe from this group, send email to lepl+unsubscribe@googlegroups=
.com.
For more options, visit this group at http://groups.google.com/group/lepl?h=
l=3Den.