Re: Doc Comments cause parser errors
| From: | Zeev Suraski | Date: | Wed, 02 Apr 2003 15:49:36 +0000 |
| Subject: | Re: Doc Comments cause parser errors | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-609@lists.php.net to get a copy of this message | ||
At 18:38 02/04/2003, Andrei Zmievski wrote:
I don't really like the idea of cluttering the parser with additional rules if it's not really necessary. I think that the idea proposed by Alan is actually the best way to go (keep the last comment in a global, use and reset it in the next relevant declaration implementation). IIRC, that's also the way the Zend Development Environment does the job :) ZeevThis 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. Actually the doc comment has to start with "/**\n" and end with "*/", so the above will work just fine (because I have a rule for doc comments with unticked_statement). The only issue right now is making rules for doc comments before class/namespace vars and constants. If I could get some help with that from Zeev/Andi/Stas, it'd be great.