Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.0

Bug #8259 Strange regex generated
Submitted: 2006-07-20 10:52 UTC Modified: 2006-08-30 15:11 UTC
From: mansion Assigned: cellog
Status: Closed Package: PHP_LexerGenerator (version 0.2.1)
PHP Version: 5.1.2 OS: OSX
Roadmaps: (Not assigned)    
Subscription  


 [2006-07-20 10:52 UTC] mansion (Bertrand Mansion)
Description: ------------ variable = @/?:([a-zA-Z0-9_]+)/?@ will generate : $yy_global_pattern = "/^(\?:([a-zA-Z0-9_]+)\?)|^(([^\]+))/"; The slashes are replaced by antislashes. The @ delimiter is replaced by a slash (which I can understand if it's a documented standard). Not sure if this is a bug or an error on my side as I am pretty new to the package. Test script: --------------- /*!lex2php %input $this->data %counter $this->N %token $this->token %value $this->value %line $this->line variable = @/?:([a-zA-Z0-9_]+)/?@ */

Comments

 [2006-07-21 03:57 UTC] mansion at php dot net (Bertrand Mansion)
in Parser.y, line 548, 551, 559, 562 should use \/ instead of \\.
 [2006-07-27 18:42 UTC] cellog (Greg Beaver)
the replacement with // is indeed expected behavior. The regex is in fact parsed and then regenerated. I will fix the other problem when I have the time. Thanks for the report.
 [2006-08-30 15:11 UTC] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.