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

Bug #9211 Typos
Submitted: 2006-11-01 20:59 UTC
From: vishvananda at yahoo dot com Assigned: cellog
Status: Closed Package: PHP_LexerGenerator (version 0.3.0)
PHP Version: Irrelevant OS: N/A
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 37 - 22 = ?

 
 [2006-11-01 20:59 UTC] vishvananda at yahoo dot com (Vishvananda Ishaya)
Description: ------------ I found some typos in the Lexer Generator version 0.3.0 causing the line numbers to break: in Parser.php there are various instances of the following: ' . $this->line . ' += substr_count("\n", ' . $this->value . '); which doesn't work because the haystack comes first in substr_count. They should say: ' . $this->line . ' += substr_count($this->value, ' . "\n" . '); also, the function doLongestMatch does not have the following code from doFirstMatch: if (' . $this->counter . ' >= strlen(' . $this->input . ')) { return false; // end of input } which means that doLongestMatch will throw an error when it reaches the end of input instead of returning false. Is this intended behavior? If so, how does one know to stop calling the yylex function?

Comments

 [2006-11-01 21:07 UTC] vishvananda at yahoo dot com
er sorry, it should say: ' . $this->line . ' += substr_count(' . $this->value . ', "\n");
 [2006-12-16 00:13 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.