-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
47 lines (47 loc) · 1008 Bytes
/
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
export type Token =
| VariableDef
| FunctionDef
| FunctionCall
| SpriteDef
| Return;
export interface VariableDef {
type: 'variableDef';
name: string;
value: InputValue;
constant: boolean;
}
export interface FunctionDef {
type: 'functionDef';
name: string;
codeLines: Array<Token>;
}
export interface SpriteDef {
type: 'spriteDef';
name: string;
functions: Array<Token>;
}
export interface FunctionCall {
type: 'functionCall';
name: string;
args: Array<InputValue>;
}
export interface ObjectLiteral {
type: 'objectLiteral';
value: PObject;
}
export interface ObjectReference {
type: 'objectReference';
name: string;
}
export interface Return {
type: 'return';
value: InputValue;
}
export type InputValue = ObjectLiteral | ObjectReference | FunctionCall;
export type PObject = string | number;
export type RefId = string;
export type ParsedInputValue = ObjectLiteral | BlockReference;
export interface BlockReference {
type: 'blockReference';
id: string;
}