* 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
`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.
Rename `nextPreview` and `prevPreview` to `nextCharacter` and `prevCharacter`
respectively so that these function names reflect the purpose of these functions.
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.
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.