refactor: strictly typed

This commit is contained in:
harttle
2019-02-23 00:49:54 +08:00
parent 51f7e66f60
commit 5b6100d12b
86 changed files with 2630 additions and 2590 deletions
+4 -3
View File
@@ -1,15 +1,16 @@
export default class Token {
type: string
type: string = 'notset'
line: number
col: number
raw: string
input: string
file: string
file?: string
value: string
constructor (raw, col, input, file, line) {
constructor (raw: string, input: string, line: number, col: number, file?: string) {
this.col = col
this.line = line
this.raw = raw
this.value = raw
this.input = input
this.file = file
}