Merge branch '1.x' into 2.x

* 1.x:
  Add support for exponential numbers
  Fix phpdoc
This commit is contained in:
Fabien Potencier
2019-11-07 22:14:26 +01:00
4 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -288,7 +288,7 @@
* 1.42.4 (2019-XX-XX)
* n/a
* added supported for exponential numbers
* 1.42.3 (2019-08-24)
+1 -1
View File
@@ -435,7 +435,7 @@ class Environment
*
* This method should not be used as a generic way to load templates.
*
* @param string $template The template name
* @param string $template The template source
* @param string $name An optional name of the template to be used in error messages
*
* @return TemplateWrapper A template instance representing the given template name
+1 -1
View File
@@ -44,7 +44,7 @@ class Lexer
const STATE_INTERPOLATION = 4;
const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A';
const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A';
const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A';
const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As';
const REGEX_DQ_STRING_DELIM = '/"/A';
const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As';
@@ -0,0 +1,8 @@
--TEST--
Twig manages exponentiel numbers correctly
--TEMPLATE--
{{ 1.99E+3 }}
--DATA--
return []
--EXPECT--
1990