Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25157 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20725 invoked by uid 1010); 2 Aug 2006 23:00:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20709 invoked from network); 2 Aug 2006 23:00:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Aug 2006 23:00:36 -0000 X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Linux 2.5 (sometimes 2.4) (4) Received: from ([66.11.173.122:45215] helo=blobule.interjinn.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 69/AE-44390-F7E21D44 for ; Wed, 02 Aug 2006 19:00:35 -0400 Received: by blobule.interjinn.com (Postfix, from userid 2000) id 3D2AA5ACE3E; Wed, 2 Aug 2006 19:07:25 -0400 (EDT) To: ceo@l-i-e.com Cc: internals@lists.php.net In-Reply-To: <65312.67.108.68.40.1154556866.squirrel@www.l-i-e.com> References: <347185750.20060715202622@marcus-boerger.de> <20060715204801.4e02c985@pierre-u64> <56975.64.4.222.245.1153017351.squirrel@www.l-i-e.com> <1153018028.3177.4.camel@blobule> <65312.67.108.68.40.1154556866.squirrel@www.l-i-e.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: InterJinn Date: Wed, 02 Aug 2006 19:07:24 -0400 Message-ID: <1154560045.5178.47.camel@blobule> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Subject: Re: [PHP-DEV] Re: Long awaited line directive From: robert@interjinn.com (Robert Cummings) On Wed, 2006-08-02 at 17:14 -0500, Richard Lynch wrote: > On Sat, July 15, 2006 9:47 pm, Robert Cummings wrote: > > This has some really good implications for helping PHP users get the > > line numbers more correct. For instance, from what I gather, my > > template > > engine can use this to dynamically generate PHP code from an XML tag > > and > > when the generated code fails due to some syntax error based on the > > tag's attributes, If my engine included this directive then the engine > > will tell them in what included template source file and on what line > > they screwed up rather than them seeing an error that has no obvious > > relationship whatsoever to what they did (did I get that right > > Marcus?). > > So, what would the code look like that fixes this issue, from the > sample posted? > > It seems to me like you're still going to get an error message about > the right line number, but in the wrong file name. > > Or is #file also going in with #line, so your template engine can > forge the filename for __FILE__ to the included file? I can see that > working to solve this for you. A file specification will also be part of the line directive. I believe Marcus mentioned that in one of his posts. > Working backwards from generated code to source files in templates is > never fun, but solving this in PHP code instead of the template itself > seems like a case of killing a fly with a cannon. It can't be properly solved in PHP land without hacks that are still not as useful as the line directive. > It may make life a tiny bit easier for the experts, but I suspect > #line is going to be abused by the naive to make life hell on the > masses... I don't think the naive will go near it. They would need someone to tell them about it :) Of course, I'm sure it will happen, but that's why documentation exists. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'