Passed
Push — main ( d506c6...8104af )
by Dylan
03:33
created

Token.toString   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0
cc 1
crap 1
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