NOTE: In order to build lexpjs with Unicode-friendly identifiers enabled (if, for some reason, the included pre-built lexp.js
file doesn't suit your needs), you first need to modify jison-lex to allow Unicode property escapes in its RegExps. See README-lexer.md
for details.
- Fix degenerate case of
case
statement with a singlewhen
and anelse
(which is really anif
made complex).
- Add
range()
function with more flexibility than short-cut range operator (..
).
- Add
asin()
,acos()
,atan()
andatan2()
, which function identically to their JavaScriptMath
library counterparts. - Add
pi
(lowercase) as reserved word; gives the value ofMath.PI
. - Test function extended to allow function for expected result (i.e. function returns boolean
true
for valid expression result,false
otherwise).
- Add
quote()
function
- Resolve what I feel to be an inconsistency in JavaScript's implementation of
isNaN()
. In JS, if you passnull
, the result is false, but passingnull
toparseInt()
orparseFloat()
will returnNaN
. I think these should behave consistently, so I've modified lexpjs'isNaN()
to return true when its argument isnull
(i.e.null
is not a number). The JS behavior was discovered/verified in nodejs 16.13.1 and Chrome browser 108.0.5359.98.
- Improve
if...then...else...endif
with addition ofelif <cond> then <expr-list>
alternates.
- Improve
time()
string parsing so that time-only strings (HH:MM[:SS[.TTT]]
) are correctly parsed, and date-only strings are supported (within the limited of parsing of the JavaScriptDate
constructor, which handles many common forms). Time-only strings will be converted to the given time on the current date (in the current timezone). Date-only strings will return midnight as the time component (in the current timezone).
The CHANGELOG was first produced for version 22203; please refer to Github commit comments for details prior to this version.