0FGVYqxHQZ has asked for the wisdom of the Perl Monks concerning the following question:
~/linux/test/perl/library/Regexp/Grammars/</=/\$ cat main.pl #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my $grammar = do { use Regexp::Grammars; qr{ (?#<logfile:->) <delimited_string> <token: delimited_string> <ldelim=str_delim> .*? <rdelim=\ldelim> <token: str_delim> ["'`] }xms; }; my $string = "''"; if ($string =~ $grammar) { print Dumper \%/; } ~/linux/test/perl/library/Regexp/Grammars/</=/\$ ./main.pl error | Found call to <ldelim=str_delim>, but no <rule: str_delim> or | <token: str_delim> was defined in the grammar | (Did you misspell the rule name or forget to define the rule? +) | error | Found call to <______0_88_str_delim>, but no <rule: ______0_8 +8_str_delim> or | <token: ______0_88_str_delim> was defined in the grammar | (Did you misspell the rule name or forget to define the rule? +) | error | Found call to <str_delim>, but no <rule: str_delim> or | <token: str_delim> was defined in the grammar | (Did you misspell the rule name or forget to define the rule? +) | warn | Possible invalid subrule call: | <ldelim=str_delim> | (To silence this warning, use: \<ldelim=str_delim> | warn | Possible invalid subrule call: | <rdelim=(?{; *Regexp::Grammars::LOGFILE | (To silence this warning, use: \<rdelim=(?{; *Regexp::Grammar +s::LOGFILE | warn | Possible invalid subrule call: | <______0_88_str_delim> | (To silence this warning, use: \<______0_88_str_delim> | warn | Possible invalid subrule call: | <str_delim> | (To silence this warning, use: \<str_delim> | Eval-group not allowed at runtime, use re 'eval' in regex m/(?{; *Rege +xp::Grammars::LOGFILE = Regexp::Grammars::_open_log('>>','-'); })((? +{; @! = () if !.../ at ./main.pl line 10.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The usage of <ALIAS=\IDENT> of Regexp::Grammars
by DamianConway (Beadle) on Aug 16, 2012 at 04:12 UTC | |
|
Re: The usage of <ALIAS=\IDENT> of Regexp::Grammars
by Anonymous Monk on Aug 10, 2012 at 01:29 UTC |