*** empty log message ***

This commit is contained in:
andrey
2001-01-18 17:41:30 +00:00
parent f2482645e0
commit b5461c2c2a
2 changed files with 26 additions and 24 deletions

View File

@@ -426,11 +426,12 @@ class Smarty
default: default:
if (isset($this->custom_funcs[$tag_command])) { if (isset($this->custom_funcs[$tag_command])) {
return $this->_compile_custom_tag($tag_command, $tag_args); return $this->_compile_custom_tag($tag_command, $tag_args);
} else } else {
/* TODO syntax error: unknown tag */ trigger_error("Smarty: syntax error: unknown tag - '$tag_command'", E_USER_WARNING);
return ""; return "";
} }
} }
}
function _compile_custom_tag($tag_command, $tag_args) function _compile_custom_tag($tag_command, $tag_args)
@@ -453,7 +454,7 @@ class Smarty
$name = substr($attrs['name'], 1, -1); $name = substr($attrs['name'], 1, -1);
if (empty($name)) { if (empty($name)) {
/* TODO syntax error: missing insert name */ trigger_error("Smarty: syntax error: missing insert name", E_USER_ERROR);
} }
foreach ($attrs as $arg_name => $arg_value) { foreach ($attrs as $arg_name => $arg_value) {
@@ -472,7 +473,7 @@ class Smarty
$attrs = $this->_parse_attrs($tag_args); $attrs = $this->_parse_attrs($tag_args);
if (empty($attrs['file'])) { if (empty($attrs['file'])) {
/* TODO syntax error: missing 'file' attribute */ trigger_error("Smarty: syntax error: missing 'file' attribute in config_load tag", E_USER_ERROR);
} }
$output = "<?php if (!class_exists('Config_File'))\n" . $output = "<?php if (!class_exists('Config_File'))\n" .
@@ -496,7 +497,7 @@ class Smarty
$attrs = $this->_parse_attrs($tag_args); $attrs = $this->_parse_attrs($tag_args);
if (empty($attrs['file'])) { if (empty($attrs['file'])) {
/* TODO syntax error: missing 'file' attribute */ trigger_error("Smarty: syntax error: missing 'file' attribute in include tag", E_USER_ERROR);
} else } else
$attrs['file'] = $this->_dequote($attrs['file']); $attrs['file'] = $this->_dequote($attrs['file']);
@@ -530,7 +531,7 @@ class Smarty
$output = "<?php\n"; $output = "<?php\n";
$section_name = $attrs['name']; $section_name = $attrs['name'];
if (empty($section_name)) { if (empty($section_name)) {
/* TODO syntax error: section needs a name */ trigger_error("Smarty: syntax error: missing section name", E_USER_ERROR);
} }
$output .= "unset(\$_sections[$section_name]);\n"; $output .= "unset(\$_sections[$section_name]);\n";
@@ -716,12 +717,12 @@ class Smarty
$expr_arg = $tokens[$expr_end++]; $expr_arg = $tokens[$expr_end++];
$expr = "!($is_arg % $expr_arg)"; $expr = "!($is_arg % $expr_arg)";
} else { } else {
/* TODO syntax error: expecting 'by' */ trigger_error("Smarty: syntax error: expecting 'by' after 'div'", E_USER_ERROR);
} }
break; break;
default: default:
/* TODO strict syntax checking */ trigger_error("Smarty: syntax error: unknown 'is' expression - '$expr_type'", E_USER_ERROR);
break; break;
} }
@@ -761,7 +762,7 @@ class Smarty
$attr_name = $token; $attr_name = $token;
$state = 1; $state = 1;
} else } else
/* TODO syntax error: invalid attr name */; trigger_error("Smarty: syntax error: invalid attribute name - '$token'", E_USER_ERROR);
break; break;
case 1: case 1:
@@ -774,7 +775,7 @@ class Smarty
if ($token == '=') { if ($token == '=') {
$state = 2; $state = 2;
} else } else
/* TODO syntax error: expecting '=' */; trigger_error("Smarty: syntax error: expecting '=' after attribute name", E_USER_ERROR);
break; break;
case 2: case 2:
@@ -798,7 +799,7 @@ class Smarty
$attrs[$attr_name] = $token; $attrs[$attr_name] = $token;
$state = 0; $state = 0;
} else } else
/* TODO syntax error: '=' can't be a value */; trigger_error("Smarty: syntax error: '=' cannot be an attribute value", E_USER_ERROR);
break; break;
} }
} }

View File

@@ -426,11 +426,12 @@ class Smarty
default: default:
if (isset($this->custom_funcs[$tag_command])) { if (isset($this->custom_funcs[$tag_command])) {
return $this->_compile_custom_tag($tag_command, $tag_args); return $this->_compile_custom_tag($tag_command, $tag_args);
} else } else {
/* TODO syntax error: unknown tag */ trigger_error("Smarty: syntax error: unknown tag - '$tag_command'", E_USER_WARNING);
return ""; return "";
} }
} }
}
function _compile_custom_tag($tag_command, $tag_args) function _compile_custom_tag($tag_command, $tag_args)
@@ -453,7 +454,7 @@ class Smarty
$name = substr($attrs['name'], 1, -1); $name = substr($attrs['name'], 1, -1);
if (empty($name)) { if (empty($name)) {
/* TODO syntax error: missing insert name */ trigger_error("Smarty: syntax error: missing insert name", E_USER_ERROR);
} }
foreach ($attrs as $arg_name => $arg_value) { foreach ($attrs as $arg_name => $arg_value) {
@@ -472,7 +473,7 @@ class Smarty
$attrs = $this->_parse_attrs($tag_args); $attrs = $this->_parse_attrs($tag_args);
if (empty($attrs['file'])) { if (empty($attrs['file'])) {
/* TODO syntax error: missing 'file' attribute */ trigger_error("Smarty: syntax error: missing 'file' attribute in config_load tag", E_USER_ERROR);
} }
$output = "<?php if (!class_exists('Config_File'))\n" . $output = "<?php if (!class_exists('Config_File'))\n" .
@@ -496,7 +497,7 @@ class Smarty
$attrs = $this->_parse_attrs($tag_args); $attrs = $this->_parse_attrs($tag_args);
if (empty($attrs['file'])) { if (empty($attrs['file'])) {
/* TODO syntax error: missing 'file' attribute */ trigger_error("Smarty: syntax error: missing 'file' attribute in include tag", E_USER_ERROR);
} else } else
$attrs['file'] = $this->_dequote($attrs['file']); $attrs['file'] = $this->_dequote($attrs['file']);
@@ -530,7 +531,7 @@ class Smarty
$output = "<?php\n"; $output = "<?php\n";
$section_name = $attrs['name']; $section_name = $attrs['name'];
if (empty($section_name)) { if (empty($section_name)) {
/* TODO syntax error: section needs a name */ trigger_error("Smarty: syntax error: missing section name", E_USER_ERROR);
} }
$output .= "unset(\$_sections[$section_name]);\n"; $output .= "unset(\$_sections[$section_name]);\n";
@@ -716,12 +717,12 @@ class Smarty
$expr_arg = $tokens[$expr_end++]; $expr_arg = $tokens[$expr_end++];
$expr = "!($is_arg % $expr_arg)"; $expr = "!($is_arg % $expr_arg)";
} else { } else {
/* TODO syntax error: expecting 'by' */ trigger_error("Smarty: syntax error: expecting 'by' after 'div'", E_USER_ERROR);
} }
break; break;
default: default:
/* TODO strict syntax checking */ trigger_error("Smarty: syntax error: unknown 'is' expression - '$expr_type'", E_USER_ERROR);
break; break;
} }
@@ -761,7 +762,7 @@ class Smarty
$attr_name = $token; $attr_name = $token;
$state = 1; $state = 1;
} else } else
/* TODO syntax error: invalid attr name */; trigger_error("Smarty: syntax error: invalid attribute name - '$token'", E_USER_ERROR);
break; break;
case 1: case 1:
@@ -774,7 +775,7 @@ class Smarty
if ($token == '=') { if ($token == '=') {
$state = 2; $state = 2;
} else } else
/* TODO syntax error: expecting '=' */; trigger_error("Smarty: syntax error: expecting '=' after attribute name", E_USER_ERROR);
break; break;
case 2: case 2:
@@ -798,7 +799,7 @@ class Smarty
$attrs[$attr_name] = $token; $attrs[$attr_name] = $token;
$state = 0; $state = 0;
} else } else
/* TODO syntax error: '=' can't be a value */; trigger_error("Smarty: syntax error: '=' cannot be an attribute value", E_USER_ERROR);
break; break;
} }
} }