-
Notifications
You must be signed in to change notification settings - Fork 23
/
literal.ts
48 lines (42 loc) · 1.25 KB
/
literal.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { EtherUnit, LiteralKind, TimeUnit } from "../../constants";
import { PrimaryExpression } from "./primary_expression";
export class Literal extends PrimaryExpression {
/**
* The type of literal: `number`, `string`, `bool`, `hexString` or `unicodeString`.
*/
kind: LiteralKind;
/**
* Hexadecimal representation of value of the literal symbol
*/
hexValue: string;
/**
* Value of the literal symbol
*/
value: string;
/**
* The denomination number literal when explicitly specified.
*
* Possible values for time: `seconds`, `minutes`, `hours`, `days` or `weeks`
* (also `years` for Solidity 0.4.x).
*
* Possible values for ether: `wei`, `gwei` or `ether`
* (also `finney` and `szabo` prior to Solidity 0.7.0).
*/
subdenomination?: TimeUnit | EtherUnit;
constructor(
id: number,
src: string,
typeString: string,
kind: LiteralKind,
hexValue: string,
value: string,
subdenomination?: TimeUnit | EtherUnit,
raw?: any
) {
super(id, src, typeString, raw);
this.kind = kind;
this.hexValue = hexValue;
this.value = value;
this.subdenomination = subdenomination;
}
}