blob: a34b5e6e0ca691a81caa7e11d393a1269229a9de (
plain)
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
|
#include "lls.h"
/* value type */
enum
{
VT_UNKNOWN = 0,
VT_NULL, // null | |
VT_REAL, // real | float |
VT_STRING, // string | char* |
VT_BOOLEAN, // boolean | char |
VT_SET, // set | void* |
VT_ARRAY, // array | void* |
VT_FUNCTION, // function | void* | ڴͬĺ
};
typedef struct
{
int type;
union
{
int _integer;
float _decimal;
char* _string;
char _bool;
void* _set;
void* _array;
int _func;
} value;
} lls_Value;
/* ָ,֧255 */
enum
{
MOVE = 1,
ADD,
};
typedef struct
{
int ins;
void* operant;
} lls_Ins;
int lls_bindfunction(lls_Env* env, const char* fname, lls_Func func)
{
}
|