mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 02:16:41 +00:00
Merge branch '1.x' into 2.x
* 1.x: Add support for exponential numbers Fix phpdoc
This commit is contained in:
@@ -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
@@ -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
@@ -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
|
||||
Reference in New Issue
Block a user