-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstruction.ts
31 lines (30 loc) · 971 Bytes
/
instruction.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
import type { Value } from "./value.ts";
export type Instruction =
| { type: "Minus" }
| { type: "LessThanEqual" }
| { type: "GreaterThanEqual" }
| { type: "AccessProperty"; name: string }
| { type: "DefineProperty"; name: string }
| { type: "ChannelReceive" }
| { type: "ChannelSend" }
| { type: "Exit" }
| { type: "Jump"; offset: number }
| { type: "Spawn"; arity: number }
| { type: "Yield" }
| { type: "Print" }
| { type: "JumpIfFalse"; offset: number }
| { type: "GetLocal"; name: string }
| { type: "SetLocal"; name: string }
| { type: "DeclareLocal"; name: string }
| { type: "GetGlobal"; name: string }
| { type: "SetGlobal"; name: string }
| { type: "DeclareGlobal"; name: string }
| { type: "BlockEnd" }
| { type: "BlockStart" }
| { type: "Return" }
| { type: "Call"; arity: number }
| { type: "GreaterThan" }
| { type: "LessThan" }
| { type: "Plus" }
| { type: "Pop" }
| { type: "Push"; value: Value };