- Evaluating a phrase like
1 +could lead to an error being thrown due to the internalsepByparsing consuming a separator even if there was not valid input following it. This has been fixed, and tests added to verify.
- Speed up string parsing.
- Spaces are now required between infix string ops (eg
or) and their arguments, but are still not required with normal infix ops (eg+). This avoids potential ambiguity, and should line up with what is expected to have worked anyway.
- String functions can now be used as infix ops without back ticks if they take exactly
two arguments, and are listed in the
precedencearray.
- Back ticks are no longer supported; to use functions infix, ensure that they take
exactly two arguments, and add them to the
precedencearray.
- Fix a little now-incorrect information in the README
- Allow local variables to be provided to eval calls
- Add example of a language for pulling values from from objects/JSON
- Move examples out to their own folder, to make it easier to find the example you want.
- Better, faster number parsing.
- Using
prepareContextnow leads to greater performance improvements, particularly when evaluating many small expressions using a single prepared context verses creating a new one every time.
- Parse errors are now wrapped in a higher level error message to avoid returning often useless implementation details.
Value.eval()now returns undefined ifValueis a variable which isn't in scope. It used to return the token name instead in this case, but this can now be obtained by usingValue.name()in those cases where you'd want it.
Values, as given back to functions, now no longer expose the raw expression object but instead provide several methods to access useful information for them.- Numeric parsing has been improved: exponents are now allowed, and slightly more flexibility around how decimal points are handled.
- no more
.raw()function is available on Values.
.is now a valid character to use as an operator.- Numbers that end in
.(eg "3.") will no longer consume the.on parsing, leaving it to potentially be parsed as an operator instead. - Control flow examples have been added, and misc doc improvements.
- Result returned from
evaluatecall now has convenience methods attached, rather than needing to use standalone methods provided to do the same prepareContextfunction added to allow state sharing across evaluate calls
isOkandisErrare no longer exported, but instead are available on the result of theevaluatecall.
- Angu now supports string literals #3
- Functions are now provided
Values, which can be evaluated using.eval(). This allows for lazy evaluation, and obtaining other information fromValues.
- Ops are now parsed based on what is provided in scope, so invalid ops will not parse, and valid ops can parse unambiguously even when no spaces separate them.
- All errors now contain consistent position information.
- The type of error returned as aa result of an invalid op being used is now a parse error rather than an evaluation error.
- Unary ops now parse after numbers in order to avoid conflicts with parsing '-'/'+' on numbers.
- Infix functions are now surrounded in backticks, to free up single quotes for future usage.
- To use a function as an infix op, it should now be prefixed with
'instead of:.
Initial release