formatting...

This commit is contained in:
Miles Lott 2001-12-24 05:24:57 +00:00
parent 573c7089d1
commit de3504fd20

View File

@ -21,23 +21,23 @@
/* if set, echo assignments */
var $debug = False;
/* $file[handle] = "filename"; */
/* $file[handle] = 'filename'; */
var $file = array();
/* relative filenames are relative to this pathname */
var $root = "";
var $root = '';
/* $varkeys[key] = "key"; $varvals[key] = "value"; */
/* $varkeys[key] = 'key'; $varvals[key] = 'value'; */
var $varkeys = array();
var $varvals = array();
/* "remove" => remove undefined variables
* "comment" => replace undefined variables with comments
* "keep" => keep undefined variables
/* 'remove' => remove undefined variables
* 'comment' => replace undefined variables with comments
* 'keep' => keep undefined variables
*/
var $unknowns = 'remove';
/* "yes" => halt, "report" => report error, continue, "no" => ignore error quietly */
/* 'yes' => halt, 'report' => report error, continue, 'no' => ignore error quietly */
var $halt_on_error = 'yes';
/* last error message is retained here */
@ -69,7 +69,7 @@
}
/* public: set_unknowns(enum $unknowns)
* unknowns: "remove", "comment", "keep"
* unknowns: 'remove', 'comment', 'keep'
*
*/
function set_unknowns($unknowns = 'keep')
@ -105,7 +105,7 @@
}
}
/* public: set_block(string $parent, string $handle, string $name = "")
/* public: set_block(string $parent, string $handle, string $name = '')
* extract the template $handle from $parent,
* place variable {$name} instead.
*/
@ -324,13 +324,12 @@
{
switch ($this->unknowns)
{
case "keep":
case 'keep':
break;
case "remove":
$str = preg_replace('/{[^ \t\r\n}]+}/', "", $str);
case 'remove':
$str = preg_replace('/{[^ \t\r\n}]+}/', '', $str);
break;
case "comment":
case 'comment':
$str = preg_replace('/{([^ \t\r\n}]+)}/', "<!-- Template $handle: Variable \\1 undefined -->", $str);
break;
}