25 Commits

Author SHA1 Message Date
Eric Mansfield
aadb63ef3b Bugfix for bignumber divided by unit (#1270)
* Bugfix for bignumber divided by unit

* Expanded out numeric.js, improved divideScalar.js

* Minor comments
2018-10-05 20:53:49 +02:00
Eric Mansfield
d23d8c71a4 Chained conditionals (#1267)
* Minimally working

* Added tests, toString

* Added tests for evaluation

* Minor changes

* Added a line in the docs about chained conditionals

* Documentation, replacing var and let with const
2018-10-04 20:26:39 +02:00
greenkeeper[bot]
c5971b371a Update standard to the latest version 🚀 (#1226)
* chore(package): update standard to version 12.0.0

* update to new lint version with --fix

I believe this mainly adds whitespace to `{}`'s.

* Replace assert.equal with assert.strictEqual

This breaks a lot of tests which I will endevour to fix in the next
commits.

* Fix most errors due to assert.strictEquals

Some instances of `strictEquals` are replaced by `deepEquals`.
`toString` has been used to make some string comparisions explicit.
Tests will still fail untill #1236 and #1237 are fixed.

* Fix assertion erros due to -0

With node 10, assert.strictEqual no longer considers `0 === -0`.
I missed these first time round as I was using node 8.

* Put toString correct side of bracket

I was converting the constructor to a string rather
than the result of the computation. Oops.

* Fixed #1236: quantileSeq has inconsistant return

* Update package-lock

* Fixed #1237: norm sometimes returning a complex number instead of number

* Fix cli tests

* More changes for standardjs, and fixes in unit tests
2018-09-08 16:33:58 +02:00
jos
9b2d2d4611 Release v5.1.0 2018-08-12 21:35:20 +02:00
Jason Shin
c4662ab3bb Implemented function getMatrixDataType (#1172)
* getMatrixDataType implemented

* implementing the last feedback ;)

* refactor

* hiding getArrayDataType from public API
2018-08-12 18:23:04 +02:00
jean-emmanuel
710ed1e58f Add support for single quotes strings 2018-08-04 10:27:10 +02:00
Harry Sarson
f2f6a3c9c2
remove c from parsing state
`state.c` is always equal to `state.expression.charAt(state.index)`.
Therefore, the property `c` does not need to be included in the state.
This commit replaces all occurances of `state.c` with `currentCharacter(state)`.

This commit adds two functions:
  - `currentCharacter` replaces `state.c`
  - `currentString` which returns a substring starting at the current character.
2018-07-08 12:51:46 +01:00
Harry Sarson
e83c5be8ff
rename functions that peak at characters
Rename `nextPreview` and `prevPreview` to `nextCharacter` and `prevCharacter`
respectively so that these function names reflect the purpose of these functions.
2018-07-08 12:51:46 +01:00
Harry Sarson
85f012837b
remove function first
`first()` reset the state to an initial value.
Now parse no longer uses global variables this is not needed any more.
2018-07-08 12:51:45 +01:00
Harry Sarson
e596ab4992
pass state as a parameter to each function
This commit entirely removes the global state from `parse`.
The state is passed as an object to each function, functions modify the state passed to them.
2018-07-08 12:51:45 +01:00
Harry Sarson
223bab67de
remove global tokenStates
This global variable was only used in `parseRule2` so was removed from the global scope and added
to this function instead.
2018-07-08 12:51:45 +01:00
Harry Sarson
f8a917113a
combine global pass state into a couple of objects
Combines most of the global state used when passing expressions into an object called `state`.
This makes it easier to refactor this code going forward and clarifies which functions touch the global state.

`tokenStates` is still a seperate global variable which now contains copies of the state.
2018-07-08 12:51:13 +01:00
jos
f6f7bd2b25 Fixed #1088: function arguments not being passed to rawArgs functions 2018-07-04 14:05:07 +02:00
jos
e844004cbf Removed redundant escape characters 2018-06-13 21:15:10 +02:00
jos
b0ec2d4739 Fixed undefined variables/globals 2018-06-13 18:09:19 +02:00
jos
0583771e4e Cleanup unused variables and imports 2018-06-13 17:25:51 +02:00
jos
fdf3dca4ba disable warnings on unmodified loop condition 2018-06-13 16:45:04 +02:00
jos
f1ce473457 Consistend camel case naming of variables and functions 2018-06-13 16:09:51 +02:00
jos
b1777e3cf9 Fixed mixing || and && in expressions 2018-06-13 15:38:57 +02:00
jos
b6b36bfd9b Use strict equality checks everywhere (=== and !==) 2018-06-13 15:02:21 +02:00
jos
b3b96749bf Refactored var into const/let, and removed a lot of semicolons 2018-06-13 12:21:14 +02:00
jos
c2777c856b Fixed linting issues "Unexpected template string expression" 2018-06-12 21:18:45 +02:00
jos
adccb818ea Replace tabs with spaces 2018-06-10 20:51:53 +02:00
jos
024b2a9e26 Fix most lint errors using npx standard --fix 2018-06-10 20:28:27 +02:00
jos
35329d7db4 Move lib to src 2018-06-06 14:37:39 +02:00