aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes
Commit message (Collapse)AuthorAgeFilesLines
* Support for unary positive expressions (#85)Javier Marín2021-03-051-3/+3
| | | * Support for unary positive operator
* Unary Minus (#84)V2.1.7Bruce Wells2021-02-171-31/+39
| | | Fixed unary minus to allow a minus sign in front of functions and parentheses.
* Improved support for null variables (#72)V2.1.2Javier Marín2020-09-151-3/+1
| | | | | | | | | | | | | | * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic * Better support for null variables * Better support for null variables * Better support for null variables
* Handler for not found variables (#68)Javier Marín2020-07-261-3/+11
| | | | | | | | * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic
* Variable fixes (#67)V2.0.3Bruce Wells2020-06-044-11/+13
| | | | | | | | | | | * Reproduce if throws UnknownOperatorException * Fix variable detection * Adding IncorrectNumberOfFunctionParametersException * Removing tabs * Better exception message text
* Code style fixes & Github Actions (#65)V2.0.2Alexander Kiryukhin2020-06-014-9/+5
| | | | | | | | | | | | * Code style fixes Up phpunit to v8 New CI * Remove travis * Fix CI badge * Added php-cs-fixer action
* Merge branch 'master' into neonxp-ngBruce Wells2020-05-201-1/+1
|\
| * WIP: New generation (#62)Alexander Kiryukhin2020-05-2033-1573/+514
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Massive refactoring More clean structure Parsing without regular expressions * Cleanup unused imports * Fix version string for Travis * 7.1 downgrade * Fix readme
* | typed parameters and return typesBruce Wells2020-05-204-14/+14
| |
* | 7.1 downgradeAlexander Kiryukhin2020-05-151-13/+2
| |
* | Cleanup unused importsAlexander Kiryukhin2020-05-151-6/+0
| |
* | Massive refactoringAlexander Kiryukhin2020-05-1533-1568/+526
|/ | | | | More clean structure Parsing without regular expressions
* Negative expression start (#60)V1.1.4Bruce Wells2020-04-211-2/+2
| | | | | * Update documentation for PHPFUI/InstaDoc * Support for negative numbers starting paren enclosed expressions
* Update documentation for PHPFUI/InstaDoc (#58)Bruce Wells2020-04-114-3/+13
|
* Fix substraction by zero bug (#56)Clément Lafont2020-02-071-2/+14
|
* 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-2614-10/+434
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Subtraction fix (#46)v0.8.0Bruce Wells2019-08-161-2/+18
| | | | | * Updated unit tests * Fixed docs * Better unary minus support
* Fixed typo in constantBruce Wells2019-01-161-1/+1
|
* Fixed comma operatorBruce Wells2019-01-164-14/+42
| | | | | Added unit tests for expressions in function arguments. Changed array_push to $var[] = native code.
* Fixed function parameter orderBruce Wells2019-01-122-10/+6
| | | | | | | 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-1121-162/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Syncing to origin (#4)Bruce Wells2019-01-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Syncing from origin (#3)Bruce Wells2019-01-101-3/+8
| | | | | | | | * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36)
* Fixed function in () block issueBruce Wells2018-11-261-130/+133
|
* Division By Zero Exception supportBruce Wells2018-10-313-1/+66
| | | | | | 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-246-1/+57
|
* 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-064-5/+27
| |\
| | * Merge branch 'master' into getters_for_function_and_operatorsAlexander Kiryukhin2018-09-063-5/+5
| | |\
| | * | Add ability to get functions and operators that have been registeredBruce Wells2018-08-311-0/+22
| | | |
| * | | Exception MessagesBruce Wells2018-08-282-4/+4
| |/ / | | | | | | | | | Basically the token that is causing the exception for better diagnostics.
* | / Support for double quoted stringsBruce Wells2018-09-125-22/+73
| |/ |/| | | | | | | | | | | | | 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
| |
* | Bug fixes about "Undefined offset -1" if stack is empty array and token ↵ochi512017-09-121-2/+2
| | | | | | | | association is RIGHT_ASSOC
* | 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'
* ~ Fix PHP 5.3 compatibilityNeonXP2013-09-061-2/+3
|
* ~ Fix PHP 5.3 compatibilityNeonXP2013-09-061-1/+1
|
* + Added cache, which speeds up the repetitive calculationsNeonXP2013-09-064-4/+70
| | | | + Returned variables, because they need for cached expressions
* Mass refactoringNeonXP2013-09-0622-355/+847
| | | | | | | | | | | 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
* Fix to PSR standart, fix tokenizer, fix function executor.zhukv2013-08-034-0/+355