Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:606 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13548 invoked from network); 2 Apr 2003 15:42:16 -0000 Received: from unknown (HELO localhost.localdomain) (65.198.110.5) by pb1.pair.com with SMTP; 2 Apr 2003 15:42:16 -0000 Received: (from andrei@localhost) by localhost.localdomain (8.11.6/8.11.6) id h32FfO110357; Wed, 2 Apr 2003 10:41:24 -0500 X-Authentication-Warning: localhost.localdomain: andrei set sender to andrei@gravitonic.com using -f Date: Wed, 2 Apr 2003 10:41:24 -0500 To: Andi Gutmans Cc: Sascha Schumann , Sebastian Bergmann , internals@lists.php.net Message-ID: <20030402154124.GB10280@hyperion.gravitonic.com> Mail-Followup-To: Andrei Zmievski , Andi Gutmans , Sascha Schumann , Sebastian Bergmann , internals@lists.php.net References: <5.1.0.14.2.20030402091017.032db718@127.0.0.1> <5.1.0.14.2.20030402091017.032db718@127.0.0.1> <5.1.0.14.2.20030402092156.0310bb68@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20030402092156.0310bb68@127.0.0.1> User-Agent: Mutt/1.4i Subject: Re: [PHP-DEV] Doc Comments cause parser errors From: andrei@gravitonic.com (Andrei Zmievski) On Wed, 02 Apr 2003, Andi Gutmans wrote: > 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). No, it won't fail. Look: statement: unticked_statement { zend_do_ticks(TSRMLS_C); } | doc_comment { zend_do_free(&$1 TSRMLS_CC); } unticked_statement { zend_do_ticks(TSRMLS_C); } ; This allows doc comments before any non-declarative statement. The only remaining problem is having doc comments before class vars and constants. If you think it's better to go with the approach that Alan outlined, I can live with that too, but it seems easier to handle this in the parser rather than in zend_do_* functions and also having to reset the doc comment for each statement. -Andrei http://www.gravitonic.com/ The Feynman problem solving algorithm: 1) Write down the problem. 2) Think real hard. 3) Write down the answer.