m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/__tests__/lexer.test.js
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-09-11 15:47:50 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-09-11 15:47:50 -0400
commit9368b1c33db290d7c80c93db5c867cdb7fcaf14d (patch)
treec6170c157985624b373a13bb540bd4070321c18c /__tests__/lexer.test.js
parentda6582f328c17e1842a4632d88e06d851e7c4b5f (diff)
Implement collecting
Diffstat (limited to '__tests__/lexer.test.js')
-rw-r--r--__tests__/lexer.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/__tests__/lexer.test.js b/__tests__/lexer.test.js
index 7124746..b2cb77e 100644
--- a/__tests__/lexer.test.js
+++ b/__tests__/lexer.test.js
@@ -171,6 +171,18 @@ describe('lex', () => {
{ type: 'constant', value: 4 }
])
})
+
+ it('[2d8]+3', () => {
+ expect(lex('[2d8]+3')).toEqual([
+ { type: '[' },
+ { type: 'constant', value: 2 },
+ { type: 'd' },
+ { type: 'constant', value: 8 },
+ { type: ']' },
+ { type: 'plus' },
+ { type: 'constant', value: 3 }
+ ])
+ })
})
describe('lexes negatives', () => {