* Added approx_eq! macro for expm1 tests.
Added approx_eq! macro for expm1 tests due to floating point arithmetic
inaccuracies, using default ULP & epsilon values. approx_eq! macro does
not work for NaN values, however, for tests this should be okay anyway!
Solves #664.
* Modified Cargo.toml to remove unneeded feature.
Removed std feature as was unused in test.
* Moves `float-cmp` to Dev Dependencies
Refactors tan() unit test, previously unused, to use approx_eq!() macro
for assertion to pass on CI.
* Fixes cargo fmt errors
* Implement optional parameter `radix` for `Number.prototype.toString( [radix] )
Implement the radix paramet for the `toString`. This implementation is
converted from the V8's c++ implementation.
* Use a reversed iterator instead of cursors in the integer part.
Initial version for getting rid of direct slice accesses. Currently
converted integer part to iterators. Fraction part is a lot harder since
there are two passes to the fraction part (for carry over) and it is
hard to express that using iterators.
* Format tests
New parser!
Plus loads of tidy up in various places.
Co-authored-by: Jason Williams <jwilliams720@bloomberg.net>
Co-authored-by: HalidOdat <halidodat@gmail.com>
Co-authored-by: Iban Eguia <iban.eguia@cern.ch>
Co-authored-by: Iban Eguia <razican@protonmail.ch>
* Added the ability to dump the token stream or ast in bin.
The dump functionality works both for files and REPL.
With --dump-tokens or -t for short it dumps the token stream to stdout and --dump-ast or -a for short to dump the ast to stdout.
The dumping of tokens and ast is mutually exclusive. and when dumping it wont run the code.
* Fixed some issues with rustfmt.
* Added serde serialization and deserialization to token and the ast.
* Added a dynamic multi-format dumping of token stream and ast in bin.
- Changed the --dump-tokens and --dump-ast to be an optional argument that optionally takes a value of format type ([--opt=[val]]).
- The default format for --dump-tokens and --dump-ast is Debug format which calls std::fmt::Debug.
- Added Json and JsonMinified format for both dumps, use serde_json internally.
- It is easy to support other format types, such as Toml with toml-rs for example.
* Made serde an optional dependency.
- Serde serialization and deserialization can be switched on by using the feature flag "serde-ast".
* Changed the JSON dumping format.
- Now Json dumping format prints the data in minefied JSON form by default.
- Removed JsonMinified.
- Added JsonPretty as a way to dump the data in pretty printed JSON format.
* Updated the docs.