Mantis - Quercus
Viewing Issue Advanced Details
4139 minor always 07-25-10 10:00 07-25-10 10:00
kdecherf  
 
normal  
new 4.0.8  
open  
none    
none  
0004139: "unknown lexeme:/ in" error when a comment is between 'implements' keyword and '{'
An error 500 is caught when a comment is between 'implements' keyword and '{' (class declaration beginning).

Error report:
----
com.caucho.quercus.parser.QuercusParseException: /home/kdecherf/Working/Workspaces/quercus-4.0.8/build/web/quercus.php:8: unknown lexeme:/ in
quercus.php:6:
quercus.php:7: class MyClass implements
quercus.php:8: /* Implementation class */
quercus.php:9: Implement {
quercus.php:10:
----

I fixed it with two new functions : ignoreMultilineComment() and ignoreSinglelineComment() to ignore comments during execution of parseNamespaceIdentifier().

You can find a patch proposal in attachment (source based on SVN repo).
Example file to reproduce error:

<?php

class Implement {
    function _test() { echo __CLASS__.':'.__FUNCTION__.'()'; }
}

class MyClass implements
    /* Implementation class */
    Implement {

    function __construct() {
        echo $this->_test();
    }
}

$Class = new MyClass();
?>
 QuercusParser.patch [^] (2,438 bytes) 07-25-10 10:00

There are no notes attached to this issue.