diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-08-22 15:15:07 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-08-22 15:15:07 -0400 |
commit | ee9a05d3c4fbdcb34777ae75a9ae1499b1098add (patch) | |
tree | 46a48f46c10497a4b35b647edc96334a0f703fa8 /__tests__/parser.test.js | |
parent | 56d36c9129292cd0dd0b5e79eea14d79a4219a94 (diff) |
Change arithmetic lexing
- Rename tokens from symbols ('+', '-'), to words
- Differentiate between symbols with and without surrounding whitespace
- Update parser to work with new token names
Diffstat (limited to '__tests__/parser.test.js')
-rw-r--r-- | __tests__/parser.test.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/__tests__/parser.test.js b/__tests__/parser.test.js index fb554f9..bc88894 100644 --- a/__tests__/parser.test.js +++ b/__tests__/parser.test.js @@ -152,8 +152,8 @@ describe('parse', () => { }) }) - test('2d(6+3)d4', () => { - expect(parse('2d(6+3)d4')).toEqual({ + test('2d(6 + 3)d4', () => { + expect(parse('2d(6 + 3)d4')).toEqual({ type: 'd', left: { type: 'constant', value: 2 }, right: { |