diff options
| author | Uwe.Tews <uwe.tews@localhost> | 2009-11-23 16:05:30 +0000 |
|---|---|---|
| committer | Uwe.Tews <uwe.tews@localhost> | 2009-11-23 16:05:30 +0000 |
| commit | 963b13b0af5818068109755e1223746497015d0e (patch) | |
| tree | 517a20bb8393c89391ef94ec6ca2c05cba278402 /libs/sysplugins/smarty_internal_configfilelexer.php | |
| parent | 631e3023ccacf9f5b71a71110016e8af7f7e64b0 (diff) | |
| download | smarty-963b13b0af5818068109755e1223746497015d0e.tar.gz smarty-963b13b0af5818068109755e1223746497015d0e.tar.bz2 smarty-963b13b0af5818068109755e1223746497015d0e.zip | |
- fixed configfile parser for text starting with a numeric char
- the default_template_handler_func may now return a filepath to a template source
Diffstat (limited to 'libs/sysplugins/smarty_internal_configfilelexer.php')
| -rw-r--r-- | libs/sysplugins/smarty_internal_configfilelexer.php | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/libs/sysplugins/smarty_internal_configfilelexer.php b/libs/sysplugins/smarty_internal_configfilelexer.php index 57cce5d6..0e685a6b 100644 --- a/libs/sysplugins/smarty_internal_configfilelexer.php +++ b/libs/sysplugins/smarty_internal_configfilelexer.php @@ -80,16 +80,15 @@ class Smarty_Internal_Configfilelexer 6 => 0, 7 => 0, 8 => 1, - 10 => 1, + 10 => 0, + 11 => 0, 12 => 0, 13 => 0, - 14 => 0, - 15 => 0, ); if ($this->counter >= strlen($this->data)) { return false; // end of input } - $yy_global_pattern = "/^(#)|^('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*')|^(\"\"\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"\"\")|^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^(\\d+(\\.\\d+)?)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)/"; + $yy_global_pattern = "/^(#)|^('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*')|^(\"\"\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"\"\")|^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)/"; do { if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) { @@ -129,19 +128,18 @@ class Smarty_Internal_Configfilelexer // skip this token continue; } else { $yy_yymore_patterns = array( - 1 => array(0, "^('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*')|^(\"\"\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"\"\")|^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^(\\d+(\\.\\d+)?)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), - 2 => array(0, "^(\"\"\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"\"\")|^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^(\\d+(\\.\\d+)?)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), - 3 => array(0, "^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^(\\d+(\\.\\d+)?)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), - 4 => array(0, "^(\\[)|^(])|^(\\s*=\\s*)|^(\\d+(\\.\\d+)?)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), - 5 => array(0, "^(])|^(\\s*=\\s*)|^(\\d+(\\.\\d+)?)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), - 6 => array(0, "^(\\s*=\\s*)|^(\\d+(\\.\\d+)?)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), - 7 => array(0, "^(\\d+(\\.\\d+)?)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), - 8 => array(1, "^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), - 10 => array(2, "^([\s]+)|^(\\.)|^(\\w+)|^(.)"), - 12 => array(2, "^(\\.)|^(\\w+)|^(.)"), - 13 => array(2, "^(\\w+)|^(.)"), - 14 => array(2, "^(.)"), - 15 => array(2, ""), + 1 => array(0, "^('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*')|^(\"\"\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"\"\")|^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), + 2 => array(0, "^(\"\"\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"\"\")|^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), + 3 => array(0, "^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), + 4 => array(0, "^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), + 5 => array(0, "^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), + 6 => array(0, "^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), + 7 => array(0, "^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"), + 8 => array(1, "^([\s]+)|^(\\.)|^(\\w+)|^(.)"), + 10 => array(1, "^(\\.)|^(\\w+)|^(.)"), + 11 => array(1, "^(\\w+)|^(.)"), + 12 => array(1, "^(.)"), + 13 => array(1, ""), ); // yymore is needed @@ -236,29 +234,24 @@ class Smarty_Internal_Configfilelexer function yy_r1_8($yy_subpatterns) { - $this->token = Smarty_Internal_Configfileparser::TPC_NUMBER; - } - function yy_r1_10($yy_subpatterns) - { - $this->token = Smarty_Internal_Configfileparser::TPC_EOL; } - function yy_r1_12($yy_subpatterns) + function yy_r1_10($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_SPACE; } - function yy_r1_13($yy_subpatterns) + function yy_r1_11($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_DOT; } - function yy_r1_14($yy_subpatterns) + function yy_r1_12($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_ID; } - function yy_r1_15($yy_subpatterns) + function yy_r1_13($yy_subpatterns) { $this->token = Smarty_Internal_Configfileparser::TPC_OTHER; |
