Skip Menu |
 

This queue is for tickets about the Regexp-Grammars CPAN distribution.

Report information
The Basics
Id: 100848
Status: resolved
Priority: 0/
Queue: Regexp-Grammars

People
Owner: DCONWAY [...] cpan.org
Requestors: SWUECHO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.036
Fixed in: (no value)



Subject: Regexp::Grammars does not clear RULE_HANDLER properly after match fails
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-14580-1418256674-1267.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 962
Download (untitled) / with headers
text/plain 962b
#!/usr/bin/env perl use v5.20; package MyAction { sub new { return bless {}, shift; } sub text { my ($self, $result) = @_; warn "\n-->auto action is called"; return $result; } } my $test_grammar = do { use Regexp::Grammars; qr{ <text> <rule: text> \w+ }x; }; say "auto action should be called"; "abc_test" =~ $test_grammar->with_actions(MyAction->new); say; say "no auto action provided, so auto action will not ba called"; "abc_test" =~ $test_grammar; say; say "match fail, so auto action should not ba called"; '$$$' =~ $test_grammar->with_actions(MyAction->new); say; say "no auto action provided, so auto action should not ba called"; say "However, becuase the RULE_HANLDLER is not cleared, after match, auto action is called"; "abc_test" =~ $test_grammar __DATA__ perl -v This is perl 5, version 20, subversion 0 (v5.20.0) built for x86_64-linux perl -MRegexp::Grammars -E 'say $Regexp::Grammars::VERSION' 1.036
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-14580-1418256674-1267.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-14580-1418256674-1267.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-14580-1418256794-256.100848-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1380
Download (untitled) / with headers
text/plain 1.3k
please see the last part: say "no auto action provided, so auto action should not ba called"; say "However, becuase the RULE_HANLDLER is not cleared, after match, auto action is called"; "abc_test" =~ $test_grammar the $RULE_HANLDER from previous match is not cleared. On Wed Dec 10 19:11:14 2014, SWUECHO wrote: Show quoted text
> #!/usr/bin/env perl > use v5.20; > > package MyAction { > sub new { > return bless {}, shift; > } > > sub text { > my ($self, $result) = @_; > warn "\n-->auto action is called"; > return $result; > } > > } > > my $test_grammar = do { > use Regexp::Grammars; > qr{ > <text> > <rule: text> \w+ > }x; > > }; > > say "auto action should be called"; > "abc_test" =~ $test_grammar->with_actions(MyAction->new); > say; > say "no auto action provided, so auto action will not ba called"; > "abc_test" =~ $test_grammar; > say; > say "match fail, so auto action should not ba called"; > '$$$' =~ $test_grammar->with_actions(MyAction->new); > say; > say "no auto action provided, so auto action should not ba called"; > say "However, becuase the RULE_HANLDLER is not cleared, after match, > auto action is called"; > "abc_test" =~ $test_grammar > > __DATA__ > perl -v > > This is perl 5, version 20, subversion 0 (v5.20.0) built for x86_64- > linux > > perl -MRegexp::Grammars -E 'say $Regexp::Grammars::VERSION' > 1.036
MIME-Version: 1.0
X-Spam-Status: No, score=-5.257 tagged_above=-99.9 required=10 tests=[AWL=1.342, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, FROM_OUR_RT=-4, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
In-Reply-To: <rt-4.0.18-14580-1418256795-933.100848-5-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-100848 [...] rt.cpan.org> <rt-4.0.18-14580-1418256674-1267.100848-5-0 [...] rt.cpan.org> <rt-4.0.18-14580-1418256795-933.100848-5-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.67.6.233 with SMTP id cx9mr12962154pad.110.1418269251997; Wed, 10 Dec 2014 19:40:51 -0800 (PST)
Message-ID: <CAATtAp5ZT1_=jffm3wJm3iA6G9MUwwaFL-xJGKzD_qB5153qug [...] mail.gmail.com>
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -5.257
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 7E91B240224 for <cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com>; Wed, 10 Dec 2014 22:40:59 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3VhYRz1NC5XC for <cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com>; Wed, 10 Dec 2014 22:40:58 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 5307E240221 for <bug-Regexp-Grammars [...] rt.cpan.org>; Wed, 10 Dec 2014 22:40:58 -0500 (EST)
Received: (qmail 5420 invoked by alias); 11 Dec 2014 03:40:57 -0000
Received: from mail-pd0-f176.google.com (HELO mail-pd0-f176.google.com) (209.85.192.176) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 10 Dec 2014 19:40:55 -0800
Received: by mail-pd0-f176.google.com with SMTP id r10so2125820pdi.7 for <bug-Regexp-Grammars [...] rt.cpan.org>; Wed, 10 Dec 2014 19:40:52 -0800 (PST)
Received: by 10.70.41.13 with HTTP; Wed, 10 Dec 2014 19:40:11 -0800 (PST)
Delivered-To: cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #100848] Regexp::Grammars does not clear RULE_HANDLER properly after match fails
Return-Path: <thoughtstream [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=LIzjzfgVeEbRVixhEQlqVSKh3JjxQuaR9I1w5qADLg4=; b=LrlwrOYU4rNeO/C+PerOHX2sajmMNq4W5SCx54qMeT4R2Q53jnwanRBJJvJC8YQ01J EdzdQ1Uj4MGcVfVsIyW1hrPTmgOdvHE1ExTrv2vVEQhDErczOSYo/nzE34nft+uEISmy z3dkVaWLBHJSo+NY+s/McfFdR6pbZIcoZhUKqGia7LFJJ5w3nXE+6CoF8LvSz0xG9k6+ GNoSmLDImJBB5aV20xE+YQpIAfE3O72tAkq3TI8+6V4cKOWzMZ/fMr0LqbFL5F1E3nrV m5DDSw9WQaFED/9UA1A9cbwmcptYQgTvO50vEtK0SDw2MHTktq8wShojfGyqjY84kVg8 4W0w==
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com
X-RT-Mail-Extension: regexp-grammars
X-Google-Sender-Auth: EgNd2DI2RQkXhZzUusDGrh3E0O8
Sender: thoughtstream [...] gmail.com
Date: Thu, 11 Dec 2014 14:40:11 +1100
X-Spam-Level:
To: bug-Regexp-Grammars [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
RT-Message-ID: <rt-4.0.18-18834-1418269260-1289.100848-0-0 [...] rt.cpan.org>
Content-Length: 145
Download (untitled) / with headers
text/plain 145b
Thank-you for this report. I apologize for the bug. I have now uploaded a new release which I believe solves the problem. All the best, Damian
MIME-Version: 1.0
X-Spam-Status: No, score=-6.598 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, FROM_OUR_RT=-4, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
In-Reply-To: <rt-4.0.18-18834-1418269260-1934.100848-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-100848 [...] rt.cpan.org> <rt-4.0.18-14580-1418256674-1267.100848-5-0 [...] rt.cpan.org> <rt-4.0.18-14580-1418256795-933.100848-5-0 [...] rt.cpan.org> <CAATtAp5ZT1_=jffm3wJm3iA6G9MUwwaFL-xJGKzD_qB5153qug [...] mail.gmail.com> <rt-4.0.18-18834-1418269260-1934.100848-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.42.251.68 with SMTP id mr4mr9789083icb.94.1418271958501; Wed, 10 Dec 2014 20:25:58 -0800 (PST)
Message-ID: <CAGfENy-R0cwDuWvomf+R2t4COSeMUjNB+w+_hxu3kGvBKSd25A [...] mail.gmail.com>
Content-Type: multipart/alternative; boundary="20cf3010ecbd4811a40509e92cef"
X-Spam-Score: -6.598
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 5F281240224 for <cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com>; Wed, 10 Dec 2014 23:26:08 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5IyphVxFktzV for <cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com>; Wed, 10 Dec 2014 23:26:06 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 4A35C240221 for <bug-Regexp-Grammars [...] rt.cpan.org>; Wed, 10 Dec 2014 23:26:06 -0500 (EST)
Received: (qmail 8062 invoked by alias); 11 Dec 2014 04:26:05 -0000
Received: from mail-ie0-f175.google.com (HELO mail-ie0-f175.google.com) (209.85.223.175) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 10 Dec 2014 20:26:02 -0800
Received: by mail-ie0-f175.google.com with SMTP id x19so4140053ier.20 for <bug-Regexp-Grammars [...] rt.cpan.org>; Wed, 10 Dec 2014 20:25:58 -0800 (PST)
Received: by 10.64.125.100 with HTTP; Wed, 10 Dec 2014 20:25:58 -0800 (PST)
Delivered-To: cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #100848] Regexp::Grammars does not clear RULE_HANDLER properly after match fails
Return-Path: <echowuhao [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=DUt0BLrBbOAVldBd+RPYH7LHC0T/U3Vb8o+mCP1YwD0=; b=0pKWoIeiXWOf75tDb2YVgCPGVMol6i8ioMGWZKQVT0wZrfOEGeCZ/yFVaTvFx/2PBC ZxBvSHDuHO+hwgo+2t4SKmc0PSNMDH0KIXCSBG8JEZVfetogpPOusHj3a5NDyeIqgpOF 1egSkgjs0biAcMfUdBG1JHGEdUqz6KZetoS/19hXBD820ORSX+lKDTsouCouBDzXpnSj L2K78ygD5sK4NPRLclnacwrc/vHUyAAj+19Ka0SHfj7Flj3zFNUCNYKJZ8q1107o1ocG PuT/+zKgB62YtC9NTl9TAEeOECPNi0NafutrZj/PTUyZmEeNCecn6Wj/GuNVYDhvZKo4 MEYg==
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com
X-RT-Mail-Extension: regexp-grammars
X-Google-Sender-Auth: RE04sgfvRkhrzC-BYO8GfToSfWs
Sender: echowuhao [...] gmail.com
Date: Wed, 10 Dec 2014 20:25:58 -0800
X-Spam-Level:
To: bug-Regexp-Grammars [...] rt.cpan.org
From: Hao Wu <hwu [...] intellisurvey.com>
RT-Message-ID: <rt-4.0.18-29121-1418271969-99.100848-0-0 [...] rt.cpan.org>
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 402
Download (untitled) / with headers
text/plain 402b
great! surprised to get the reply in such a short time. Thanks! Best, Hao On Wed, Dec 10, 2014 at 7:41 PM, damian@conway.org via RT < bug-Regexp-Grammars@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100848 > > > Thank-you for this report. > I apologize for the bug. > I have now uploaded a new release which I believe solves the problem. > > All the best, > > Damian > >
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 913


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.