fixed numbers when one than one decimal
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 12 Oct 2009 13:18:27 +0000 (13:18 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 12 Oct 2009 13:18:27 +0000 (13:18 +0000)
git-svn-id: http://svn.twig-project.org/trunk@33 93ef8e89-cb99-4229-a87c-7fa0fa45744b

lib/Twig/Lexer.php

index 5459736..ed78d78 100644 (file)
@@ -42,7 +42,7 @@ class Twig_Lexer implements Twig_LexerInterface
   const POSITION_VAR   = 2;
 
   const REGEX_NAME     = '/[A-Za-z_][A-Za-z0-9_]*/A';
-  const REGEX_NUMBER   = '/[0-9]+(?:\.[0-9])?/A';
+  const REGEX_NUMBER   = '/[0-9]+(?:\.[0-9]+)?/A';
   const REGEX_STRING   = '/(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')/Asm';
   const REGEX_OPERATOR = '/<=? | >=? | [!=]= | [(){}.,%*\/+~|-] | \[ | \] | \? | \:/Ax';