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