From aee14e3147ff46265fe985690d4bc62803cc6876 Mon Sep 17 00:00:00 2001 From: guilhermeblanco Date: Mon, 10 Aug 2009 21:48:59 +0000 Subject: [PATCH] [2.0] Small fix for my previous commit. --- lib/Doctrine/Common/Lexer.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/Common/Lexer.php b/lib/Doctrine/Common/Lexer.php index 2c01dac95..8451e4a36 100644 --- a/lib/Doctrine/Common/Lexer.php +++ b/lib/Doctrine/Common/Lexer.php @@ -203,10 +203,13 @@ abstract class Lexer $matches = preg_split($regex, $input, -1, $flags); foreach ($matches as $match) { + // Must remain before 'value' assignment since it can change content + $type = $this->_getType($match[0]); + $this->_tokens[] = array( 'value' => $match[0], - 'type' => $this->_getType($match[0]), - 'position' => $match[1] + 'type' => $type, + 'position' => $match[1], ); } }