34 Commits

Author SHA1 Message Date
Veeloxfire
fae65276ba
Should be able to take NAMED_DELIMITER as object keys (#1798)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-04-04 17:14:39 +02:00
Harry Sarson
b6a42c032d run standard --fix 2019-08-21 10:09:10 +01:00
jos
d8a4f3a00a Update to standard@13.0.2 2019-07-20 13:46:31 +02:00
jos
41efed79d3 Fix #1473: remove 'use strict' in every file 2019-05-26 20:21:18 +02:00
jos
6081360d6a Merged develop into modular_architecture 2019-04-13 16:51:51 +02:00
jos
70cbc3ec30 Replace http urls with https where supported 2019-02-27 13:08:42 +01:00
jos
83df09800b Merge branch 'develop' into modular_architecture_merge
# Conflicts:
#	HISTORY.md
#	gulpfile.js
#	package-lock.json
#	package.json
#	src/core/function/typed.js
#	src/expression/transform/index.js
#	src/function/statistics/sum.js
#	src/function/utils/index.js
#	src/type/unit/Unit.js
#	src/version.js
#	test/expression/node/FunctionNode.test.js
#	test/type/unit/function/createUnit.test.js
#	test/utils/bignumber/formatter.test.js
#	test/utils/number.test.js
2019-02-09 21:26:25 +01:00
jos
25be459ed3 Merge math.expression.parse into math.parse 2019-02-03 20:30:43 +01:00
jos
129848f347 Flatten classes under expression.node 2019-02-02 17:52:21 +01:00
jos
078f1dd69f Renamed methods .eval to .evaluate, updated all docs and examples accordingly 2019-01-16 10:11:32 +01:00
jos
016e10109d Fix functions having the actual config values.
Fix classes not listening for changes in config.
Decouple creating classes from `core`.
2018-12-30 20:41:06 +01:00
Gold Holk
2032a9d126 Fix object literal enable multiple lines (#1328) (#1349)
* Allow object literal expression be multiple lines

* Add test for multiple lines object literal
2018-12-06 19:37:57 +01:00
jos
01a230a996 Add /* #__PURE__ */ everywhere to enable tree-shaking in webpack 2018-12-01 11:21:36 +01:00
jos
c7e0d211b7 All functions use plain object config properties, and use a copy of the config (finalize them) 2018-11-21 21:09:20 +01:00
jos
d7ed170ba5 Converted all function transforms, expression functions, and embedded docs 2018-11-09 11:16:55 +01:00
jos
9faf91f697 Convert all data types, converted all algebra functions. Fixes in order of importing factories. 2018-11-08 15:02:18 +01:00
jos
c1a8004a12 - Created a util function factory
- Implemented resolving dependencies
- Converted the first few factory functions
2018-11-05 17:27:42 +01:00
jos
9800f25b35 Reorganized utils functions and refactored to ES6 import/export 2018-10-31 19:58:33 +01:00
jos
e3211a7efc Move all is* functions like isComplex into is.js 2018-10-31 15:28:51 +01:00
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
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
e844004cbf Removed redundant escape characters 2018-06-13 21:15:10 +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
b3b96749bf Refactored var into const/let, and removed a lot of semicolons 2018-06-13 12:21:14 +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