aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/Lexer.php
diff options
context:
space:
mode:
authorNeonXP <frei@neonxp.info>2013-09-06 08:19:02 +0400
committerNeonXP <frei@neonxp.info>2013-09-06 08:19:02 +0400
commit9cef8dbc799343f6fc0fca926fbef4917b94f335 (patch)
tree915397133271cdc9e2e86a800be02ec695184fdc /src/NXP/Classes/Lexer.php
parent4b08ec4b4dbf83dd242d7882e852b8d933ef0560 (diff)
+ Added cache, which speeds up the repetitive calculations
+ Returned variables, because they need for cached expressions
Diffstat (limited to 'src/NXP/Classes/Lexer.php')
-rw-r--r--src/NXP/Classes/Lexer.php4
1 files changed, 4 insertions, 0 deletions
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);
}