Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: keith [...] westgates.net
Cc:
AdminCc:

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



MIME-Version: 1.0
X-Spam-Status: No, score=-2.698 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
X-Spam-Flag: NO
X-Virus-Checked: Checked
Content-Type: multipart/mixed; boundary="001a113cf2f8b28aa60528edea2c"
Message-ID: <CAEGid7QG8UrCwV-tMJi7hHG0xjUfcdfeyfKs6LGhqhrQZzzV6Q [...] mail.gmail.com>
Reply-To: keith [...] westgates.net
X-Received: by 10.202.221.65 with SMTP id u62mr84920336oig.30.1452377193444; Sat, 09 Jan 2016 14:06:33 -0800 (PST)
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -2.698
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 1E0662401D7 for <cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com>; Sat, 9 Jan 2016 17:06:43 -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 Nwn4REtCfcFZ for <cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com>; Sat, 9 Jan 2016 17:06:41 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 4B9642400B5 for <bug-Regexp-Grammars [...] rt.cpan.org>; Sat, 9 Jan 2016 17:06:41 -0500 (EST)
Received: (qmail 22726 invoked by alias); 9 Jan 2016 22:06:39 -0000
Received: from mail-oi0-f51.google.com (HELO mail-oi0-f51.google.com) (209.85.218.51) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sat, 09 Jan 2016 14:06:37 -0800
Received: by mail-oi0-f51.google.com with SMTP id w75so692485oie.0 for <bug-Regexp-Grammars [...] rt.cpan.org>; Sat, 09 Jan 2016 14:06:37 -0800 (PST)
Received: by 10.202.62.70 with HTTP; Sat, 9 Jan 2016 14:05:53 -0800 (PST)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Delivered-To: cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com
Subject: with_actions class not called for match not at beginning of string
Return-Path: <westgate [...] gmail.com>
X-RT-Mail-Extension: regexp-grammars
X-Original-To: cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:from:date:message-id:subject:to:content-type; bh=V9d/XXRrWTUTnngtf2TamlytuXsi7+0Nx/Tn33Mncvw=; b=DYnEz7upUS4QlVuwodVD4+s6Wfg34oYef9eL06qadHuwIkUHHv5H/5ncrb7ngyTLix r/fzWGM2A4FU2r1jAgMPjEhsiXQjF7CB0yOLMHUxXziBmVSreyzrv3uabwVten4Etcud HKI3qM3FJdQS1sr/SDsl3U6WYBBv95uPsQ9v5t+SAD5utnTO+gToPCUGxqT8Bt/xaDIH CF67loJ71pKyBT6Fh8lPg0D+8KomxV6z05EmK5n4N0L4IlBFzmpsyFiXOvGPfOvrb/g3 ip0LQDbqYAQaLWb6b81U81ib1nmXzmYlNVpnv1/QjKGoLb37Hw5AATSU2YJpzHPEwBP5 J4Zw==
Date: Sat, 9 Jan 2016 17:05:53 -0500
X-Spam-Level:
To: bug-Regexp-Grammars [...] rt.cpan.org
From: Keith Westgate <westgate [...] gmail.com>
X-RT-Interface: Email
Content-Length: 0
Content-Type: multipart/alternative; boundary="001a113cf2f8b28a8b0528edea2a"
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 1949
Download (untitled) / with headers
text/plain 1.9k
version : Regexp-Grammars-1.044 perl: This is perl 5, version 12, subversion 2 (v5.12.2) built for x86_64-linux-thread-multi os: Linux vlsj-westgate 2.6.18-371.el5 #1 SMP Thu Sep 5 21:21:44 EDT 2013 x86_64 GNU/Linux I've taken the calc example and was playing with it. I've noticed that when the match doesn't start at the beginning of the line the with_action in not called. You'll notice below then when the data is 4, you see the message "ANSWERED called" as well as the results being "processed". however, when i feed it ".4", while it says it matched, I don't see "ANSWERED called" and the results come back as 4. output follows: vlsj-westgate@westgate_ml2@13:56:28> PERL5LIB=/vobs/uth/perl ./x.pl Show quoted text
data>>> 4
=====> Trying <grammar> from position 0 4\n |...Trying <Answer> | |...Trying subpattern /\d+/ \n | | \_____subpattern /\d+/ matched '4' ANSWER called | \_____<Answer> matched '4' --> processed Show quoted text
data>>> .4
=====> Trying <grammar> from position 0 .4\n |...Trying <Answer> | |...Trying subpattern /\d+/ | | \FAIL subpattern /\d+/ | \FAIL <Answer> \FAIL <grammar> =====> Trying <grammar> from position 1 4\n |...Trying <Answer> | |...Trying subpattern /\d+/ \n | | \_____subpattern /\d+/ matched '4' | \_____<Answer> matched '4' --> 4 Show quoted text
data>>>
here's the code: #!/grid/common/bin/perl -w use strict; use v5.10; use warnings; my $calculator = do{ use Regexp::Grammars; qr{ <debug: run> <Answer> <rule: Answer> \d+ }xms }; print("data>>> "); while (my $input = <>) { if ($input =~ $calculator->with_actions('Calculator_Actions') ) { say '--> ', $/{Answer}; } print("data>>> "); } package Calculator_Actions; use List::Util qw< reduce >; sub Answer { my ($self, $MATCH) = @_; say "ANSWER called"; my $value = "processed"; return $value; }
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 3360
X-Attachment-ID: f_ij7nrj8n0
Content-Type: text/x-perl-script; charset="US-ASCII"; name="x.pl"
Content-Disposition: attachment; filename="x.pl"
Content-Transfer-Encoding: base64
X-RT-Original-Encoding: ascii
Content-Length: 547
Download x.pl
text/x-perl 547b

Message body is not shown because sender requested not to inline it.

X-Attachment-ID: f_ij7nuddz1
Content-Type: application/octet-stream; name="run.log"
Content-Disposition: attachment; filename="run.log"
Content-Transfer-Encoding: base64
Content-Length: 652
Download run.log
application/octet-stream 652b

Message body not shown because it is not plain text.

MIME-Version: 1.0
X-Spam-Status: No, score=-5.989 tagged_above=-99.9 required=10 tests=[AWL=0.609, 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-16755-1452377204-380.111051-4-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-111051 [...] rt.cpan.org> <CAEGid7QG8UrCwV-tMJi7hHG0xjUfcdfeyfKs6LGhqhrQZzzV6Q [...] mail.gmail.com> <rt-4.0.18-16755-1452377204-380.111051-4-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.31.131.203 with SMTP id f194mr92059237vkd.90.1452574652282; Mon, 11 Jan 2016 20:57:32 -0800 (PST)
Message-ID: <CAATtAp7mqnvBS1B+gHL3VcsYMsMxGRZNDBJn0b7iETSkLVRfXQ [...] mail.gmail.com>
Content-Type: multipart/alternative; boundary="001a1145817a28bb9805291be4dc"
X-Spam-Score: -5.989
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 6C1F4240378 for <cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com>; Mon, 11 Jan 2016 23:57:46 -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 V0VrYTKQ0kOj for <cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com>; Mon, 11 Jan 2016 23:57:45 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 291DF2402C7 for <bug-Regexp-Grammars [...] rt.cpan.org>; Mon, 11 Jan 2016 23:57:45 -0500 (EST)
Received: (qmail 28394 invoked by alias); 12 Jan 2016 04:57:44 -0000
Received: from mail-vk0-f41.google.com (HELO mail-vk0-f41.google.com) (209.85.213.41) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 11 Jan 2016 20:57:36 -0800
Received: by mail-vk0-f41.google.com with SMTP id k1so236605936vkb.2 for <bug-Regexp-Grammars [...] rt.cpan.org>; Mon, 11 Jan 2016 20:57:35 -0800 (PST)
Received: by 10.31.223.197 with HTTP; Mon, 11 Jan 2016 20:56:52 -0800 (PST)
Delivered-To: cpan-bug+Regexp-Grammars [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #111051] with_actions class not called for match not at beginning of string
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=H/Iq9SF+NzBvVpkna37Xp/WjB+DXJcoFcnR4DqX0AV8=; b=mO/EEDnCwPxlAZq9UynzHyGeoVLJ3t4am3GbXTNPh/VwVZz5NL3l++DMEMEDyCViHq MNzsG18bkqnW+SqKwSgMoH7NBdXD7nGfhQ+TH0GbUVtzLoxv0fgNuSXTBZSSLOj/QhL+ CWf+m7exvr/E9tYRqbp1WcKYkpunyOr8Td11/2ZwiZmYFitD6lFCQFcWhx2nzk+Md/X4 7AsbraEPMrkkXGIyp2vtfyspncL4JgIOT0tjKrwMtCO1YfWycUNi8HsHWMOwWEz1EPtM kp5WvQMf8ET70v2JstUff94AyV6igVKafGTm+oHBWVVqBE9j66gu3OZKhV6JqNuGKPq1 8nZA==
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: _5LwBMaVeYrMRertTv5QTT98Ee4
Sender: thoughtstream [...] gmail.com
Date: Tue, 12 Jan 2016 15:56:52 +1100
X-Spam-Level:
To: bug-Regexp-Grammars [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
RT-Message-ID: <rt-4.0.18-26917-1452574667-1100.111051-0-0 [...] rt.cpan.org>
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 155
Download (untitled) / with headers
text/plain 155b
Thanks for the report, Keith. I've just uploaded v1.045, which (I hope!) squashes that bug. Let me know if you find otherwise. Much appreciated! Damian
content-type: text/html; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 249


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.