[PHP_Beautifier] questions about using tokens with NewLines()
| From: | Robert P. J. Day | Date: | Sun, 07 Mar 2010 18:31:59 +0000 |
| Subject: | [PHP_Beautifier] questions about using tokens with NewLines() | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-30371@lists.php.net to get a copy of this message | ||
trying to clarify how i can use Beautifier tokens to add newlines to
my code. here's a test script (all subsequent tests do nothing but
add the NewLines() filter):
<?php
if (true) $x = 1;
if (true) $x = 2;
if (true) {
$x = 3;
}
if (true) {
$x = 4;
}
while (true) {
$x = 5;
}
while (true) {
$x = 6;
}
?>
first, let's try "after=if":
if (true) $x = 1;
if (true) $x = 2;
if (true) {
$x = 3;
}
if (true) {
$x = 4;
}
...
obviously, not what i had in mind. similarly, i could have used the
"T_IF" token to get exactly the same effect, as in "after=T_IF",
so that doesn't help. but if i can use that token, that suggests i
can use the T_ENDIF token defined in Beautifier.php, as in
"after=T_ENDIF", but no:
if (true) $x = 1;
if (true) $x = 2;
if (true) {
$x = 3;
}
if (true) {
$x = 4;
}
while (true) {
didn't seem to make any difference. any idea why not? under what
circumstances could i use the T_ENDIF (ot T_ENDWHILE) token? if at
all.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================