Re: Re: Long awaited line directive
| From: | Marcus Boerger | Date: | Sun, 16 Jul 2006 08:31:05 +0000 |
| Subject: | Re: Re: Long awaited line directive | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-24412@lists.php.net to get a copy of this message | ||
Hello Robert,
Sunday, July 16, 2006, 4:47:08 AM, you wrote:
> On Sat, 2006-07-15 at 22:35, Richard Lynch wrote:
>> On Sat, July 15, 2006 1:48 pm, Pierre wrote:
>> > On Sat, 15 Jul 2006 20:26:22 +0200
>> > mail@marcus-boerger.de (Marcus Boerger) wrote:
>> >
>> >> Hello internals,
>> >>
>> >> attached is a patch that brings the '#line' directive to php.
>> >> This is especially usefull for parser generators or any other
>> >> code shuffling/generator tools. Any opinions? If nothing speaks
>> >> against i'd like to commit this before heading towards OSCON
>> >> be end of next week. (oatch is against head of course).
>> >>
>> >
>> > To complete the request, one example (if you are not familiar with
>> > other generators or languages):
>> >
>> > 1. include 'somfile.php'
>> > 2.
>> > #line 1 "linedirective.php"
>> > 4. class Foo // treated as line 1
>>
>> Please don't do this.
>>
>> It's hard enough to get the masses of PHP users to provide decent
>> source and line number matchups to help them debug their messes as it
>> is.
>>
>> They're just going to use this to make life much much worse...
>>
>> I can understand why there are SOME uber-geek desires for this, but,
>> honestly, I just don't see the benefits outweighing the nightmare it
>> creates...
> 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?).
Perfectly correct.
Best regards,
Marcus