64 $this->config_data[
'sections'] = array();
65 $this->config_data[
'vars'] = array();
81 $_content = $config->source->content .
"\n";
83 if ($_content ==
'') {
89 if ($this->smarty->_parserdebug)
$parser->PrintTrace();
91 while (
$lex->yylex()) {
92 if ($this->smarty->_parserdebug) echo
"<br>Parsing {$parser->yyTokenName[$lex->token]} Token {$lex->value} Line {$lex->line} \n";
97 $config->compiled_config =
'<?php $_config_vars = ' . var_export($this->config_data,
true) .
'; ?>';
115 $line = $this->lex->line;
119 $match = preg_split(
"/\n/", $this->lex->data);
120 $error_text =
"Syntax error in config file '{$this->config->source->filepath}' on line {$line} '{$match[$line-1]}' ";
123 $error_text .= $args;
126 foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
127 $exp_token = $this->parser->yyTokenName[$token];
128 if (isset($this->lex->smarty_token_names[$exp_token])) {
130 $expect[] =
'"' . $this->lex->smarty_token_names[$exp_token] .
'"';
133 $expect[] = $this->parser->yyTokenName[$token];
137 $error_text .=
' - Unexpected "' . $this->lex->value .
'", expected one of: ' . implode(
' , ', $expect);
trigger_config_file_error($args=null)
display compiler error messages without dying
compileSource(Smarty_Internal_Config $config)
Method to compile a Smarty template.
static & instance($new_instance=null)
Smarty Internal Plugin Configfilelexer.
__construct($smarty)
Initialize compiler.
static & instance($new_instance=null)