1 | import type { CompilableTemplate } from '../template.js';
|
2 | import type { SymbolTable } from '../tier1/symbol-table.js';
|
3 | import type * as WireFormat from './wire-format/api.js';
|
4 |
|
5 | export type LabelOperandType = 1;
|
6 | export type IsStrictModeOperandType = 2;
|
7 | export type DebugSymbolsOperandType = 3;
|
8 | export type BlockOperandType = 4;
|
9 | export type StdLibOperandType = 5;
|
10 | export type NonSmallIntOperandType = 6;
|
11 | export type SymbolTableOperandType = 7;
|
12 | export type LayoutOperandType = 8;
|
13 |
|
14 | export type OperandType =
|
15 | | LabelOperandType
|
16 | | IsStrictModeOperandType
|
17 | | DebugSymbolsOperandType
|
18 | | BlockOperandType
|
19 | | StdLibOperandType
|
20 | | NonSmallIntOperandType
|
21 | | SymbolTableOperandType
|
22 | | LayoutOperandType;
|
23 |
|
24 | export interface LabelOperand {
|
25 | type: LabelOperandType;
|
26 | value: string;
|
27 | }
|
28 |
|
29 | export interface IsStrictModeOperand {
|
30 | type: IsStrictModeOperandType;
|
31 | value: undefined;
|
32 | }
|
33 |
|
34 | export interface DebugSymbolsOperand {
|
35 | type: DebugSymbolsOperandType;
|
36 | value: undefined;
|
37 | }
|
38 |
|
39 | export interface BlockOperand {
|
40 | type: BlockOperandType;
|
41 | value: WireFormat.SerializedInlineBlock | WireFormat.SerializedBlock;
|
42 | }
|
43 |
|
44 | export interface StdLibOperand {
|
45 | type: StdLibOperandType;
|
46 | value:
|
47 | | 'main'
|
48 | | 'trusting-append'
|
49 | | 'cautious-append'
|
50 | | 'trusting-non-dynamic-append'
|
51 | | 'cautious-non-dynamic-append';
|
52 | }
|
53 |
|
54 | export interface NonSmallIntOperand {
|
55 | type: NonSmallIntOperandType;
|
56 | value: number;
|
57 | }
|
58 |
|
59 | export interface SymbolTableOperand {
|
60 | type: SymbolTableOperandType;
|
61 | value: SymbolTable;
|
62 | }
|
63 |
|
64 | export interface LayoutOperand {
|
65 | type: LayoutOperandType;
|
66 | value: CompilableTemplate;
|
67 | }
|
68 |
|
69 | export type HighLevelBuilderOperand =
|
70 | | LabelOperand
|
71 | | IsStrictModeOperand
|
72 | | DebugSymbolsOperand
|
73 | | StdLibOperand
|
74 | | BlockOperand
|
75 | | NonSmallIntOperand
|
76 | | SymbolTableOperand
|
77 | | LayoutOperand;
|
78 |
|
79 | export type SingleBuilderOperand =
|
80 | | HighLevelBuilderOperand
|
81 | | number
|
82 | | string
|
83 | | boolean
|
84 | | undefined
|
85 | | null
|
86 | | number[]
|
87 | | string[];
|
88 |
|
89 | export type Operand = number;
|
90 |
|
91 | export type EncoderOperands = [] | [Operand] | [Operand, Operand] | [Operand, Operand, Operand];
|