mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-03 19:30:49 +02:00
- 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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user