aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/TokenFactory.php
Commit message (Collapse)AuthorAgeFilesLines
* Logicandcompare (#50)franksl2019-11-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TokenFactory: allowing multicharacter tokens * Added logical and compare operators: <, <=, >, >=, ==, !=, ||, && * Fixed operator priorities * Error messages fixes * Fixed operators priority The priorities are assigned by following the php language standard (https://www.php.net/manual/en/language.operators.precedence.php) I've assigned precedence in steps of 10 units by following the linked page: 230 clone new 220 ** 210 ++ -- ~ (int) (float) (string) (array) (object) (bool) @ 200 instanceof 190 ! 180 * / % 170 + - . 160 << >> 150 < <= > >= 140 == != === !== <> <=> 130 & 120 ^ 110 | 100 && 90 || 80 ?? 70 ? : 60 = += -= *= **= /= .= %= &= |= ^= <<= >>= 50 yield from 40 yield 30 and 20 xor 10 or * Added if() function * Cache key fix There are cases where the cache key creation raised an error, for example while evaluating the expression "if(cos(2), cos(2), 0)", because the if() function was passing a float to the MathExecutor:execute() method.
* Fix single quotes parsing (#41)Alexander Kiryukhin2019-01-111-9/+17
| | | | | | | | | | * Fix single quotes parsing Fix e-mails Some small fixes * Mistake in test * More PHP versions
* Replaceable operators (#38)v0.7Bruce Wells2019-01-101-2/+1
| | | | | | | | | | | | | | | | | | * 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
* MathExecutor allow override default operators, functions and vars (#36)Timur2019-01-101-3/+8
|
* Division By Zero Exception supportBruce Wells2018-10-311-1/+32
| | | | | | Updated the documentation. Unit tests for strings. DivisionByZeroException support.
* Fixed merge errorBruce Wells2018-09-121-13/+0
|
* Merge branch 'master' into support_for_double_quoted_stringsBruce Wells2018-09-121-0/+12
|\
| * Merge branch 'master' into devAlexander Kiryukhin2018-09-061-0/+22
| |\
| | * Add ability to get functions and operators that have been registeredBruce Wells2018-08-311-0/+22
| | |
| * | Exception MessagesBruce Wells2018-08-281-3/+3
| |/ | | | | | | Basically the token that is causing the exception for better diagnostics.
* / Support for double quoted stringsBruce Wells2018-09-121-16/+34
|/ | | | | | | | Changed array() to [] syntax. Added variable in question to unknown variable exception. Added getVar and getVars accessor functions. Added getOperators and getFunctions accessor functions for completeness. Extended all Exceptions off MathExecutorException.
* + Added cache, which speeds up the repetitive calculationsNeonXP2013-09-061-1/+25
| | | | + Returned variables, because they need for cached expressions
* Mass refactoringNeonXP2013-09-061-0/+125
Some changes: + Added support of functions with multiple arguments + Added some default function (min, max, avg). just example of multiple arguments :) - Removed variables support (I think they pointless) ~ All tokens now in individual classes ~ Parsing based on regular expressions ~ Fix negative numbers ~ Fix grouping with brackets