Incorrect newline counters

From: Date: Sat, 29 May 2004 19:39:49 +0000
Subject: Incorrect newline counters
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2319@lists.php.net to get a copy of this message
Hello. Smarty do not preserve line numbers while compiling the template. When an error occurs, PHP shows line number in compiled file, and it does not correspond line number in the source template. Example. If I have the following template: 1 {t_block name="Title"}...{/t_block} 2 {t_block name="Author"}...{/t_block} 3 {t_block name="Text"} 4 {strip} 5 ss 6 ddd 7 {/strip} 8 {$a} and $a is undefined, I get notice not in line 8, but in other. Resulting template contains: a) superfluous \n's - in the headder comments /* compiled from ...*/, and after plugins require_once's; b) insufficient spaces - {strip} processed incorrectly, it glues its body, replacing \n by '', but not by <?php\n?> What do you thing about all that? If I write the patch which will correct line numbers, will you include it in production version? -- Best regards, Dmitry Koteroff.

« previous php.smarty.dev (#2319) next »