Re: Doc Comments cause parser errors

From: Date: Wed, 02 Apr 2003 07:19:24 +0000
Subject: Re: Doc Comments cause parser errors
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-593@lists.php.net to get a copy of this message
At 10:17 02/04/2003, Andi Gutmans wrote:
At 10:13 AM 4/2/2003 +0300, Zeev Suraski wrote:
At 09:23 02/04/2003, Andi Gutmans wrote:
At 08:16 AM 4/2/2003 +0200, Sascha Schumann wrote:
On Wed, 2 Apr 2003, Andi Gutmans wrote:
AFAIK, doc comments are for classes and functions only. I think this is what's important because interfaces are functions not variables.
    Hm, so my PHP 4-stylish code would cause a parse error, if it
    contained a valid character like a "*" after the initiation
    sequence "/*"?
Oh, I didn't think of that. You are completely right. This is definitely a problem. Andrei's patch returns a token for /** */ on the parser level so only places which are allowed to have this work. This sounds like a serious flaw because any place which has such comments will fail. I guess we'll need to revert his patch and try to think of a completely different way of doing it (unless someone has a good idea of how to solve this problem).
Why not just add the doc comment rule to variables as well, and silently ignore it? (I didn't check whether it can be done easily, but I imagine it can be done...).
This problem bites just about any places where people used /** */ as comments. For example: if ($a > 5) { /** This is a smart check *. } IMO, we can't break BC this badly.
Ah, that's right. We probably need to rethink our strategy then, and tie doc comments to the relevant tokens that follow them. Not a very easy task I think. Zeev

« previous php.internals (#593) next »