From 9cef8dbc799343f6fc0fca926fbef4917b94f335 Mon Sep 17 00:00:00 2001 From: NeonXP Date: Fri, 6 Sep 2013 08:19:02 +0400 Subject: + Added cache, which speeds up the repetitive calculations + Returned variables, because they need for cached expressions --- src/NXP/Classes/Lexer.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/NXP/Classes/Lexer.php') diff --git a/src/NXP/Classes/Lexer.php b/src/NXP/Classes/Lexer.php index 676962d..63a87b2 100644 --- a/src/NXP/Classes/Lexer.php +++ b/src/NXP/Classes/Lexer.php @@ -16,6 +16,7 @@ use NXP\Classes\Token\TokenFunction; use NXP\Classes\Token\TokenLeftBracket; use NXP\Classes\Token\TokenNumber; use NXP\Classes\Token\TokenRightBracket; +use NXP\Classes\Token\TokenVariable; use NXP\Exception\IncorrectBracketsException; use NXP\Exception\IncorrectExpressionException; @@ -67,6 +68,9 @@ class Lexer if ($token instanceof TokenNumber) { $output[] = $token; } + if ($token instanceof TokenVariable) { + $output[] = $token; + } if ($token instanceof TokenFunction) { array_push($stack, $token); } -- cgit v1.2.3