Skip to content

Commit 20c1d56

Browse files
committed
fix editor config for ts file
1 parent 4a40289 commit 20c1d56

File tree

5 files changed

+144
-149
lines changed

5 files changed

+144
-149
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
indent_style = space
33
indent_size = 4
44

5-
[*.js]
5+
[*.{js,ts}]
66
indent_style = space
77
indent_size = 2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { codeGenerator, parser, tokenizer, transformer } from "./the-super-tiny-compiler";
1+
import { codeGenerator, parser, tokenizer, transformer } from './the-super-tiny-compiler'
22

3-
const input = '(add 2 (subtract 4 2))';
4-
const output = 'add(2, subtract(4, 2));';
3+
const input = '(add 2 (subtract 4 2))'
4+
const output = 'add(2, subtract(4, 2));'
55

66
it('tiny compiler', () => {
7-
const tokens = tokenizer(input)
8-
expect(tokens).toMatchSnapshot()
9-
const ast = parser(tokens)
10-
expect(ast).toMatchSnapshot()
11-
let newAst = transformer(ast)
12-
expect(newAst).toMatchSnapshot()
13-
let o = codeGenerator(newAst)
14-
expect(o).toBe(output)
7+
const tokens = tokenizer(input)
8+
expect(tokens).toMatchSnapshot()
9+
const ast = parser(tokens)
10+
expect(ast).toMatchSnapshot()
11+
let newAst = transformer(ast)
12+
expect(newAst).toMatchSnapshot()
13+
let o = codeGenerator(newAst)
14+
expect(o).toBe(output)
1515
})

0 commit comments

Comments
 (0)