aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/Token
Commit message (Collapse)AuthorAgeFilesLines
* WIP: New generation (#62)Alexander Kiryukhin2020-05-2026-1175/+0
| | | | | | | | | | | | | | * Massive refactoring More clean structure Parsing without regular expressions * Cleanup unused imports * Fix version string for Travis * 7.1 downgrade * Fix readme
* Update documentation for PHPFUI/InstaDoc (#58)Bruce Wells2020-04-111-0/+1
|
* Left bracket and minus fix (#55)V1.1.2Clément Lafont2020-01-131-2/+6
| | | | | | * Left bracket and minus fix (#54) * Add test for left bracket and minus fix #55
* Version 1.1 (#51)V1.1.0Bruce Wells2019-11-271-1/+1
| | | | * Update README.md and more function support
* Logicandcompare (#50)franksl2019-11-2613-5/+429
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Fixed typo in constantBruce Wells2019-01-161-1/+1
|
* Fixed comma operatorBruce Wells2019-01-162-3/+32
| | | | | Added unit tests for expressions in function arguments. Changed array_push to $var[] = native code.
* Fixed function parameter orderBruce Wells2019-01-121-2/+2
| | | | | | | Corrected $places default value for addFunction to match TokenFactory Added function order test and put expected order first in assertEquals If else blocks in calculator Updated docs
* sync (#5)Bruce Wells2019-01-1118-17/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Division By Zero Exception supportBruce Wells2018-10-312-0/+34
| | | | | | Updated the documentation. Unit tests for strings. DivisionByZeroException support.
* Removing DivisionByZeroException testing for nowBruce Wells2018-10-251-4/+0
| | | | Added more unit tests.
* Additional validation for bad expressions (*+ for example)Bruce Wells2018-10-245-0/+56
|
* Support for double quoted stringsBruce Wells2018-09-122-1/+26
| | | | | | | | 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.
* Fixes exponentiation operatorochi512017-09-121-2/+2
|
* Specifically check for 0 in division to allow for negative operationsbajb2016-04-011-1/+1
|
* Avoid division by zerobajb2016-04-011-1/+1
|
* Make TokenNumber aware of scientific notationAnton Stöckl2013-09-061-1/+1
| | | | | Update the regex so scientific notation numbers work, e.g.: '1 + 3.5E-8' '1 + 3.5E8'
* + Added cache, which speeds up the repetitive calculationsNeonXP2013-09-061-0/+25
| | | | + Returned variables, because they need for cached expressions
* Mass refactoringNeonXP2013-09-0615-0/+555
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