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)    

 [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?


 [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 by the end of next Sunday (CET). If this was a problem with the 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.