- change default of $debugging_ctrl to 'NONE'

- optimization of compiled code of {foreach} and {for} loops
- change of compiler for config variables
This commit is contained in:
Uwe.Tews
2010-04-28 20:30:27 +00:00
parent 4e27b70ba5
commit d7a629df0c
8 changed files with 296 additions and 263 deletions
@@ -47,8 +47,8 @@ class Smarty_Internal_Config_File_Compiler {
}
// init the lexer/parser to compile the config file
$lex = new Smarty_Internal_Configfilelexer($_content, $this->smarty);
$parser = new Smarty_Internal_Configfileparser($lex, $this);
if (isset($this->smarty->_parserdebug)) $parser->PrintTrace();
$parser = new Smarty_Internal_Configfileparser($lex, $this);
if (isset($this->smarty->_parserdebug)) $parser->PrintTrace();
// get tokens from lexer and parse them
while ($lex->yylex()) {
if (isset($this->smarty->_parserdebug)) echo "<br>Parsing {$parser->yyTokenName[$lex->token]} Token {$lex->value} Line {$lex->line} \n";
@@ -56,8 +56,7 @@ class Smarty_Internal_Config_File_Compiler {
}
// finish parsing process
$parser->doParse(0, 0);
$config->compiled_config = serialize($this->config_data);
$config->compiled_config = '<?php $_config_vars = ' . var_export($this->config_data, true) . '; ?>';
}
/**
* display compiler error messages without dying
@@ -99,7 +98,7 @@ class Smarty_Internal_Config_File_Compiler {
// output parser error message
$error_text .= ' - Unexpected "' . $this->lex->value . '", expected one of: ' . implode(' , ', $expect);
}
throw new Exception($error_text);
throw new Exception($error_text);
}
}