This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
/
types.ts
83 lines (79 loc) · 1.95 KB
/
types.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import type * as Common from "@truffle/codec/common";
export interface TypeDescriptions {
typeIdentifier: string;
typeString?: string;
}
export interface AstNode {
constant?: boolean;
mutability?: "mutable" | "immutable" | "constant"; //variable, not function, mutability!
id: number;
name: string;
canonicalName?: string;
linearizedBaseContracts?: number[];
internalFunctionIDs?: {
[nodeId: string]: number; //note the strings are numeric
};
members?: AstNode[];
underlyingType?: AstNode;
nodes?: AstNode[];
nodeType: string;
ast_type?: string; //HACK: Vyper equivalent of nodeType
scope?: number;
src: string;
stateVariable?: boolean;
storageLocation?: string;
typeDescriptions: TypeDescriptions;
typeName?: AstNode;
expression?: {
referencedDeclaration?: any;
};
value?: null | any;
visibility?: string; //not using Visibility type above,
//that's intended for functions but this could be other
//things
stateMutability?: Common.Mutability;
kind?: string;
hexValue?: string;
referencedDeclaration?: any;
parameters?: {
parameters: AstNode[];
};
returnParameters?: {
parameters: AstNode[];
};
parameterTypes?: {
parameters: AstNode[];
};
returnParameterTypes?: {
parameters: AstNode[];
};
baseType?: AstNode;
keyType?: AstNode;
valueType?: AstNode;
payable?: boolean;
indexed?: boolean;
anonymous?: boolean;
contractKind?: Common.ContractKind;
isConstructor?: boolean;
usedErrors?: number[];
//Note: May need to add more in the future.
//May also want to create a proper system of AstNode types
//in the future, but sticking with this for now.
}
export interface AstNodes {
[nodeId: number]: AstNode;
}
//the debugger uses this
export interface Scopes {
[nodeId: string]: {
id: number;
sourceId: string;
parentId: number | null;
pointer: string;
variables?: {
name: string;
id: number;
}[];
definition?: AstNode;
};
}