11 Commits

Author SHA1 Message Date
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