src/Lexer/Token.js   A
last analyzed

Size

Lines of Code 38

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
nc 1
dl 0
loc 38
rs 10
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A Token.js ➔ ??? 0 13 1
1
/**
2
 * Lexer token representation.
3
 */
4
class Token {
5
  /**
6
   * Create a Token.
7
   * @param {String} type
8
   * @param {*} value
9
   */
10
  constructor(type, value) {
11
    /**
12
     * @private
13
     * @type {String}
14
     */
15
    this.type = type;
16
17
    /**
18
     * @private
19
     * @type {*}
20
     */
21
    this.value = value;
22
  }
23
24
  /**
25
   * Return the token type
26
   * @return {String}
27
   */
28
  getType() {
29
    return this.type;
30
  }
31
32
  /**
33
   * Return the token value
34
   * @return {*}
35
   */
36
  getValue() {
37
    return this.value;
38
  }
39
}
40
41
export default Token;
42