Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 27 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 100% |
Changes | 0 |
1 | /** |
||
2 | * @class Token |
||
3 | * @name Token |
||
4 | */ |
||
5 | 3 | export class Token { |
|
6 | type: string |
||
7 | s: string |
||
8 | |||
9 | /** |
||
10 | * Initialize a token. |
||
11 | */ |
||
12 | constructor(input: string) { |
||
13 | 5 | this.s = input |
|
14 | 5 | this.type = 'identifier' // identifier, keyword, separator, operator, literal, comment |
|
15 | } |
||
16 | |||
17 | /** |
||
18 | * The text representation. |
||
19 | */ |
||
20 | toString(): string { |
||
21 | 1 | return `${this.type}(${this.s})` |
|
22 | } |
||
23 | |||
24 | } |
||
25 | |||
26 | export default Token |
||
27 |