Subject: | argument passing into rule fails when <ws> is declared globally but not redefined in rule |
Date: | Fri, 1 May 2015 11:09:02 -0400 |
To: | bug-Regexp-Grammars [...] rt.cpan.org |
From: | "Alex C. Reed, IV" <acreed4 [...] gmail.com> |
When <token:ws> is defined in a grammar and a rule passes an argument to a
sub-rule, the sub-rule does not see said argument if <ws:> is not
re-declared inside the rule.
See attached example 'undef_arg_example.pl' and comment/uncomment lines
21-22 (<ws:> override of rule 'assign_stmt'). An output of both good and
bad versions (i.e. with and without local <ws:> declared, respectively),
along with a dump of the compiled grammar is available in good.txt and
bad.txt for easy diff'ing.
$ /bin/perl -v
This is perl 5, version 14, subversion 1 (v5.14.1) built for
x86_64-linux-thread-multi
<snip>
$ /bin/env perl -MRegexp::Grammars -e 'print $Regexp::Grammars::VERSION'
1.040
$ uname -a
Linux <scrubbed> 2.6.32-358.23.2.el6.x86_64 #1 SMP Sat Sep 14 05:32:37 EDT
2013 x86_64 x86_64 x86_64 GNU/Linux
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.