PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » PHP » PHP_LexerGenerator » Bug #9211

Typos

Details

Submitted2006-11-01 20:59 UTC
Fromvishvananda at yahoo dot com
Assignedcellog
StatusClosed
PackagePHP_LexerGenerator
PHP VersionIrrelevant
OSN/A
Roadmaps(Not assigned)

Comments

[2006-11-01 20:59 UTC] vishvananda at yahoo dot com

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");