aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/Calculator.php
diff options
context:
space:
mode:
authorBruce Wells <brucekwells@gmail.com>2019-01-11 04:18:10 +0300
committerGitHub <noreply@github.com>2019-01-11 04:18:10 +0300
commit18b12aeeff34c8ac9a350165ae36f08f4138dc9c (patch)
treee65b68200d122f4c8afbf772203dc63002ad3c7f /src/NXP/Classes/Calculator.php
parentba505031a329eaf632d1af646308482f9db57b68 (diff)
sync (#5)
* Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Added simple coc (#37) * Added simple coc * Fix * Replaceable operators (#38) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Allow for operators to be replaced based on regex expression * Fix md typo (#39) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Syncing to origin (#4) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Added simple coc (#37) * Added simple coc * Fix * Replaceable operators (#38) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Allow for operators to be replaced based on regex expression * \\ instead of \ * Update README.md Some small fixes * Fix single quotes parsing (#41) * Fix single quotes parsing Fix e-mails Some small fixes * Mistake in test * More PHP versions * Update README.md Deleted `dev` branch
Diffstat (limited to 'src/NXP/Classes/Calculator.php')
-rw-r--r--src/NXP/Classes/Calculator.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/NXP/Classes/Calculator.php b/src/NXP/Classes/Calculator.php
index 253e70c..1ceac84 100644
--- a/src/NXP/Classes/Calculator.php
+++ b/src/NXP/Classes/Calculator.php
@@ -13,13 +13,14 @@ namespace NXP\Classes;
use NXP\Classes\Token\InterfaceOperator;
use NXP\Classes\Token\TokenFunction;
use NXP\Classes\Token\TokenNumber;
-use NXP\Classes\Token\TokenString;
+use NXP\Classes\Token\TokenStringSingleQuoted;
+use NXP\Classes\Token\TokenStringDoubleQuoted;
use NXP\Classes\Token\TokenVariable;
use NXP\Exception\IncorrectExpressionException;
use NXP\Exception\UnknownVariableException;
/**
- * @author Alexander Kiryukhin <alexander@symdev.org>
+ * @author Alexander Kiryukhin <a.kiryukhin@mail.ru>
*/
class Calculator
{
@@ -38,7 +39,10 @@ class Calculator
if ($token instanceof TokenNumber) {
array_push($stack, $token);
}
- if ($token instanceof TokenString) {
+ if ($token instanceof TokenStringDoubleQuoted) {
+ array_push($stack, $token);
+ }
+ if ($token instanceof TokenStringSingleQuoted) {
array_push($stack, $token);
}
if ($token instanceof TokenVariable) {