Keval Versions Save

A Kotlin mini library for math expression string evaluation

v1.0.1

1 month ago

Summary

This release fixes two issues (issued by @serious198706)

  • #39 - Regex didn't allow tokenization of symbols that contained digits; fixed by @ZwenDo
  • #40 - Overwriting operators just did not work properly

Changelog

  • Fixed the tokenization process
  • Fixed the builder to allow operator overwrite

Integration

Please go the Github Package page to get yourself the artifacts corresponding to your platform, or use your favorite dependency manager @com.notkamui.libs:keval:1.0.1 !

Usage

For further information on usage, please read the README

v1.0.0

2 months ago

Summary

I finally put myself up to rewriting the whole engine to be grammar(-like) instead of the limited Shunting-Yard algorithm. Bugs will be way easier to fix, as well as adding new features.

Finally, unary operators are working, both prefix and postfix !

Changelog

  • Added support for unary operators (prefix and postfix)
  • Added new default operators and functions:
    • unary - (prefix)
    • unary + (prefix)
    • factorial ! (postfix)
    • new functions: abs, sqrt, cbrt, exp, ln, log10, log2, sin, cos, tan, asin, acos, atan, ceil, floor, round

Breaking change

For the 1.0.0 release, I took the liberty to make breaking changes to fix some design issues that had been there for a long time.

  • All *DSL classes are renamed to *Builder (i.e. KevalDSL -> KevalBuilder). This makes much more sense.
  • the Keval class is now immutable. This means that the constructor changed. It is now private. To create a new instance, please use the Keval::create function, as per the documentation says. Moreover, the with* methods now return a new instance instead of mutating the current one.

Integration

Please go the Github Package page to get yourself the artifacts corresponding to your platform, or use your favorite dependency manager @com.notkamui.libs:keval:1.0.0 !

Usage

For further information on usage, please read the README

v0.9.0

1 year ago

Summary

Thanks to @Holo314 (aka @Holo3146), #32 is now fixed : the consistency of the parser is now better, especially in regards to custom function parameters. ; function parameter order is now also fixed.

Moreover, KevalException and all its subclasses now extend RuntimeException (instead of Exception). For Kotlin, this shouldn't change much ; but for Java, this means no checked exception anymore (as it was a choice I regretted very quickly)

Changelog

  • Fixed incorrect behavior when mixing functions and operators (#32 )
  • Fixed function arguments (which used to be reversed)
  • KevalException now extends RuntimeException instead of Exception
  • Update to Kotlin 1.8.0

Integration

Please go the Github Package page to get yourself the artifacts corresponding to your platform, or use your favorite dependency manager @com.notkamui.libs:keval:0.9.0 !

Usage

For further information on usage, please read the README

v0.8.0

2 years ago

Summary

This release marks a new dawn on Keval ! It is now available as a multiplatform dependency, targeting the JVM, JS (node and browser), LinuxX64, and MingwX64.

Changelog

  • Dependency available for the following targets :
    • JVM
    • Node JS
    • Browser JS
    • LinuxX64
    • MingwX64
  • Update to Kotlin 1.6.0

Integration

Now that the dependencies are a bit more complex, I can't ship them separately on this page, so please go the Github Package page to get yourself the corresponding artifacts, or use your favorite dependency manager @com.notkamui.libs:keval:0.8.0 !

Usage

For further information on usage, please read the README

v0.7.5

2 years ago

This release is now compatible with Java 8 (1.8) applications.

To use it, you just need to import the attached keval-0.7.5.jar (optionally along with keval-0.7.5-sources.jar and keval-0.7.5-javadoc.jar if you want to be able to read the source and documentation code directly) OR to use your favorite dependency manager @com.notkamui.libs:keval:0.7.5

For further information on usage, please read README.md.

v0.7.4

3 years ago

This release fixes a minor bug where an empty expression would throw a NoSuchElementException ; it now throws a more suitable KevalInvalidExpressionException

To use it, you just need to import the attached keval-0.7.4.jar (optionally along with keval-0.7.4-sources.jar and keval-0.7.4-javadoc.jar if you want to be able to read the source and documentation code directly) OR to use your favorite dependency manager @com.notkamui.libs:keval:0.7.4

For further information on usage, please read README.md.

v0.7.3

3 years ago

This release adds support for a builder pattern syntax for creating a Keval instance. This update is mainly for Java users, since using the DSL in it is pretty cumbersome (lambdas, returning Unit.INSTANCE, etc).

To use it, you just need to import the attached keval-0.7.3.jar (optionally along with keval-0.7.3-sources.jar and keval-0.7.3-javadoc.jar if you want to be able to read the source and documentation code directly) OR to use your favorite dependency manager @com.notkamui.libs:keval:0.7.3

For further information on usage, please read README.md.

v0.7.2

3 years ago

This release just fixes a small bug where the wrong KevalException would be thrown in case of an error in the DSL.

Furthermore, Keval is now finally on MavenCentral !

To use it, you just need to import the attached keval-0.7.2.jar (optionally along with keval-0.7.2-sources.jar and keval-0.7.2-javadoc.jar if you want to be able to read the source and documentation code directly) OR to use your favorite dependency manager @com.notkamui.libs:keval:0.7.2

For further information on usage, please read README.md.

v0.7

3 years ago

This release has now support for constants ! There are already two built-in constants: pi, and e

To use it, you just need to import the attached keval-0.7.jar (optionally along with keval-0.7-sources.jar if you want to be able to read the source code directly)

For further information on usage, please read README.md.

v0.6.1

3 years ago

Small bugfix where Java couldn't properly receive KevalExceptions