Berry more automated solidification

This commit is contained in:
Stephan Hadinger 2022-09-14 19:39:46 +02:00
parent 6aece15bd6
commit 2f81bfff21
17 changed files with 4713 additions and 2620 deletions

View File

@ -30,7 +30,11 @@
* type when the value is 2.
* Default: 2
*/
#ifdef TASMOTA
#define BE_INTGER_TYPE 1 // use long int = uint32_t
#else
#define BE_INTGER_TYPE 0
#endif
/* Macro: BE_USE_SINGLE_FLOAT
* Select floating point precision.

View File

@ -14,9 +14,10 @@ import re
# sys.path().push('src/embedded') # allow to import from src/embedded
# globals that need to exist to make compilation succeed
var globs = "path,ctypes_bytes_dyn,tasmota,ccronexpr,gpio,light,webclient,load"
var globs = "path,ctypes_bytes_dyn,tasmota,ccronexpr,gpio,light,webclient,load,MD5,lv,light_state"
var files = ['tasmota_class.be', 'leds.be', 'animate_module.be', 'autoconf_module.be','driver_class.be']
var files = ['tasmota_class.be', 'leds.be', 'animate_module.be', 'autoconf_module.be','driver_class.be',
'partition_core.be','i2c_driver.be','hue_bridge.be','persist.be','uuid.be']
for g:string.split(globs, ",")
global.(g) = nil

View File

@ -5,712 +5,5 @@
#include "be_constobj.h"
#if defined(USE_EMULATION) && defined(USE_EMULATION_HUE)
/********************************************************************
** Solidified function: full_status
********************************************************************/
be_local_closure(hue_bridge_monad_full_status, /* name */
be_nested_proto(
11, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str(hue_ntv),
/* K1 */ be_nested_str(lights),
/* K2 */ be_nested_str(contains),
/* K3 */ be_nested_str(full_state),
/* K4 */ be_nested_str(light),
/* K5 */ be_nested_str(name),
/* K6 */ be_nested_str(model),
/* K7 */ be_nested_str(manuf),
}),
&be_const_str_full_status,
&be_const_str_solidified,
( &(const binstruction[17]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
0x880C0101, // 0001 GETMBR R3 R0 K1
0x8C0C0702, // 0002 GETMET R3 R3 K2
0x5C140200, // 0003 MOVE R5 R1
0x7C0C0400, // 0004 CALL R3 2
0x780E0009, // 0005 JMPF R3 #0010
0x880C0101, // 0006 GETMBR R3 R0 K1
0x940C0601, // 0007 GETIDX R3 R3 R1
0x8C100503, // 0008 GETMET R4 R2 K3
0x5C180200, // 0009 MOVE R6 R1
0x941C0704, // 000A GETIDX R7 R3 K4
0x94200705, // 000B GETIDX R8 R3 K5
0x94240706, // 000C GETIDX R9 R3 K6
0x94280707, // 000D GETIDX R10 R3 K7
0x7C100C00, // 000E CALL R4 6
0x80040800, // 000F RET 1 R4
0x80000000, // 0010 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: hue_status
********************************************************************/
be_local_closure(hue_bridge_monad_hue_status, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str(hue_ntv),
/* K1 */ be_nested_str(lights),
/* K2 */ be_nested_str(contains),
/* K3 */ be_nested_str(light_state),
/* K4 */ be_nested_str(light),
}),
&be_const_str_hue_status,
&be_const_str_solidified,
( &(const binstruction[13]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
0x880C0101, // 0001 GETMBR R3 R0 K1
0x8C0C0702, // 0002 GETMET R3 R3 K2
0x5C140200, // 0003 MOVE R5 R1
0x7C0C0400, // 0004 CALL R3 2
0x780E0005, // 0005 JMPF R3 #000C
0x8C0C0503, // 0006 GETMET R3 R2 K3
0x88140101, // 0007 GETMBR R5 R0 K1
0x94140A01, // 0008 GETIDX R5 R5 R1
0x94140B04, // 0009 GETIDX R5 R5 K4
0x7C0C0400, // 000A CALL R3 2
0x80040600, // 000B RET 1 R3
0x80000000, // 000C RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: add_light
********************************************************************/
be_local_closure(hue_bridge_monad_add_light, /* name */
be_nested_proto(
10, /* nstack */
6, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[14]) { /* constants */
/* K0 */ be_nested_str(int),
/* K1 */ be_nested_str(value_error),
/* K2 */ be_nested_str(id_X20must_X20be_X20of_X20type_X20_X27int_X27),
/* K3 */ be_nested_str(light_state),
/* K4 */ be_nested_str(light_X20must_X20be_X20of_X20class_X20_X27light_state_X27),
/* K5 */ be_const_int(0),
/* K6 */ be_nested_str(missing_X20name),
/* K7 */ be_nested_str(Unknown),
/* K8 */ be_nested_str(Tasmota),
/* K9 */ be_nested_str(lights),
/* K10 */ be_nested_str(light),
/* K11 */ be_nested_str(name),
/* K12 */ be_nested_str(model),
/* K13 */ be_nested_str(manuf),
}),
&be_const_str_add_light,
&be_const_str_solidified,
( &(const binstruction[43]) { /* code */
0x60180004, // 0000 GETGBL R6 G4
0x5C1C0200, // 0001 MOVE R7 R1
0x7C180200, // 0002 CALL R6 1
0x20180D00, // 0003 NE R6 R6 K0
0x781A0000, // 0004 JMPF R6 #0006
0xB0060302, // 0005 RAISE 1 K1 K2
0x6018000F, // 0006 GETGBL R6 G15
0x5C1C0400, // 0007 MOVE R7 R2
0xB8220600, // 0008 GETNGBL R8 K3
0x7C180400, // 0009 CALL R6 2
0x741A0000, // 000A JMPT R6 #000C
0xB0060304, // 000B RAISE 1 K1 K4
0x60180008, // 000C GETGBL R6 G8
0x5C1C0600, // 000D MOVE R7 R3
0x7C180200, // 000E CALL R6 1
0x5C0C0C00, // 000F MOVE R3 R6
0x6018000C, // 0010 GETGBL R6 G12
0x5C1C0600, // 0011 MOVE R7 R3
0x7C180200, // 0012 CALL R6 1
0x1C180D05, // 0013 EQ R6 R6 K5
0x781A0000, // 0014 JMPF R6 #0016
0xB0060306, // 0015 RAISE 1 K1 K6
0x5C180800, // 0016 MOVE R6 R4
0x741A0000, // 0017 JMPT R6 #0019
0x58100007, // 0018 LDCONST R4 K7
0x5C180A00, // 0019 MOVE R6 R5
0x741A0000, // 001A JMPT R6 #001C
0x58140008, // 001B LDCONST R5 K8
0x88180109, // 001C GETMBR R6 R0 K9
0x601C0013, // 001D GETGBL R7 G19
0x7C1C0000, // 001E CALL R7 0
0x981E1402, // 001F SETIDX R7 K10 R2
0x981E1603, // 0020 SETIDX R7 K11 R3
0x60200008, // 0021 GETGBL R8 G8
0x5C240800, // 0022 MOVE R9 R4
0x7C200200, // 0023 CALL R8 1
0x981E1808, // 0024 SETIDX R7 K12 R8
0x60200008, // 0025 GETGBL R8 G8
0x5C240A00, // 0026 MOVE R9 R5
0x7C200200, // 0027 CALL R8 1
0x981E1A08, // 0028 SETIDX R7 K13 R8
0x98180207, // 0029 SETIDX R6 R1 R7
0x80000000, // 002A RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: remove_light
********************************************************************/
be_local_closure(hue_bridge_monad_remove_light, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(lights),
/* K1 */ be_nested_str(remove),
}),
&be_const_str_remove_light,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x80000000, // 0004 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(hue_bridge_monad_init, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str(lights),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[ 4]) { /* code */
0x60040013, // 0000 GETGBL R1 G19
0x7C040000, // 0001 CALL R1 0
0x90020001, // 0002 SETMBR R0 K0 R1
0x80000000, // 0003 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: discover
********************************************************************/
be_local_closure(hue_bridge_monad_discover, /* name */
be_nested_proto(
11, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[13]) { /* constants */
/* K0 */ be_nested_str(hue_ntv),
/* K1 */ be_nested_str(json),
/* K2 */ be_nested_str(string),
/* K3 */ be_nested_str(lights),
/* K4 */ be_nested_str(keys),
/* K5 */ be_nested_str(full_status),
/* K6 */ be_nested_str(_X22),
/* K7 */ be_nested_str(_X22_X3A),
/* K8 */ be_nested_str(push),
/* K9 */ be_nested_str(stop_iteration),
/* K10 */ be_const_int(0),
/* K11 */ be_nested_str(concat),
/* K12 */ be_nested_str(_X2C),
}),
&be_const_str_discover,
&be_const_str_solidified,
( &(const binstruction[40]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
0xA40A0200, // 0001 IMPORT R2 K1
0xA40E0400, // 0002 IMPORT R3 K2
0x60100012, // 0003 GETGBL R4 G18
0x7C100000, // 0004 CALL R4 0
0x60140010, // 0005 GETGBL R5 G16
0x88180103, // 0006 GETMBR R6 R0 K3
0x8C180D04, // 0007 GETMET R6 R6 K4
0x7C180200, // 0008 CALL R6 1
0x7C140200, // 0009 CALL R5 1
0xA802000F, // 000A EXBLK 0 #001B
0x5C180A00, // 000B MOVE R6 R5
0x7C180000, // 000C CALL R6 0
0x8C1C0105, // 000D GETMET R7 R0 K5
0x5C240C00, // 000E MOVE R9 R6
0x7C1C0400, // 000F CALL R7 2
0x781E0008, // 0010 JMPF R7 #001A
0x60200008, // 0011 GETGBL R8 G8
0x5C240C00, // 0012 MOVE R9 R6
0x7C200200, // 0013 CALL R8 1
0x00220C08, // 0014 ADD R8 K6 R8
0x00201107, // 0015 ADD R8 R8 K7
0x001C1007, // 0016 ADD R7 R8 R7
0x8C200908, // 0017 GETMET R8 R4 K8
0x5C280E00, // 0018 MOVE R10 R7
0x7C200400, // 0019 CALL R8 2
0x7001FFEF, // 001A JMP #000B
0x58140009, // 001B LDCONST R5 K9
0xAC140200, // 001C CATCH R5 1 0
0xB0080000, // 001D RAISE 2 R0 R0
0x6014000C, // 001E GETGBL R5 G12
0x5C180800, // 001F MOVE R6 R4
0x7C140200, // 0020 CALL R5 1
0x24140B0A, // 0021 GT R5 R5 K10
0x78160003, // 0022 JMPF R5 #0027
0x8C14090B, // 0023 GETMET R5 R4 K11
0x581C000C, // 0024 LDCONST R7 K12
0x7C140400, // 0025 CALL R5 2
0x80040A00, // 0026 RET 1 R5
0x80000000, // 0027 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: light_to_id
********************************************************************/
be_local_closure(hue_bridge_monad_light_to_id, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str(lights),
/* K1 */ be_nested_str(keys),
/* K2 */ be_nested_str(light),
/* K3 */ be_nested_str(stop_iteration),
}),
&be_const_str_light_to_id,
&be_const_str_solidified,
( &(const binstruction[20]) { /* code */
0x60080010, // 0000 GETGBL R2 G16
0x880C0100, // 0001 GETMBR R3 R0 K0
0x8C0C0701, // 0002 GETMET R3 R3 K1
0x7C0C0200, // 0003 CALL R3 1
0x7C080200, // 0004 CALL R2 1
0xA8020009, // 0005 EXBLK 0 #0010
0x5C0C0400, // 0006 MOVE R3 R2
0x7C0C0000, // 0007 CALL R3 0
0x88100100, // 0008 GETMBR R4 R0 K0
0x94100803, // 0009 GETIDX R4 R4 R3
0x94100902, // 000A GETIDX R4 R4 K2
0x1C100204, // 000B EQ R4 R1 R4
0x78120001, // 000C JMPF R4 #000F
0xA8040001, // 000D EXBLK 1 1
0x80040600, // 000E RET 1 R3
0x7001FFF5, // 000F JMP #0006
0x58080003, // 0010 LDCONST R2 K3
0xAC080200, // 0011 CATCH R2 1 0
0xB0080000, // 0012 RAISE 2 R0 R0
0x80000000, // 0013 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: cmd
********************************************************************/
be_local_closure(hue_bridge_monad_cmd, /* name */
be_nested_proto(
18, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[31]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(lights),
/* K2 */ be_nested_str(contains),
/* K3 */ be_nested_str(light),
/* K4 */ be_nested_str(load),
/* K5 */ be_nested_str(tasmota),
/* K6 */ be_nested_str(log),
/* K7 */ be_nested_str(BRY_X3A_X20invalid_X20hue_X20payload_X3A_X20),
/* K8 */ be_const_int(3),
/* K9 */ be_nested_str(on),
/* K10 */ be_nested_str(set_power),
/* K11 */ be_nested_str(xy),
/* K12 */ be_const_int(0),
/* K13 */ be_const_int(1),
/* K14 */ be_nested_str(set_xy),
/* K15 */ be_nested_str(hue),
/* K16 */ be_nested_str(sat),
/* K17 */ be_nested_str(type),
/* K18 */ be_nested_str(set_hue16sat),
/* K19 */ be_nested_str(ct),
/* K20 */ be_nested_str(set_ct),
/* K21 */ be_nested_str(bri),
/* K22 */ be_nested_str(set_bri),
/* K23 */ be_nested_str(keys),
/* K24 */ be_nested_str(_X2Flights_X2F),
/* K25 */ be_nested_str(_X2Fstate_X2F),
/* K26 */ be_nested_str(success),
/* K27 */ be_nested_str(push),
/* K28 */ be_nested_str(stop_iteration),
/* K29 */ be_nested_str(signal_change),
/* K30 */ be_nested_str(dump),
}),
&be_const_str_cmd,
&be_const_str_solidified,
( &(const binstruction[167]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x88100101, // 0001 GETMBR R4 R0 K1
0x8C100902, // 0002 GETMET R4 R4 K2
0x5C180200, // 0003 MOVE R6 R1
0x7C100400, // 0004 CALL R4 2
0x74120000, // 0005 JMPT R4 #0007
0x80000800, // 0006 RET 0
0x88100101, // 0007 GETMBR R4 R0 K1
0x94100801, // 0008 GETIDX R4 R4 R1
0x94100903, // 0009 GETIDX R4 R4 K3
0x60140013, // 000A GETGBL R5 G19
0x7C140000, // 000B CALL R5 0
0x8C180704, // 000C GETMET R6 R3 K4
0x5C200400, // 000D MOVE R8 R2
0x7C180400, // 000E CALL R6 2
0x4C1C0000, // 000F LDNIL R7
0x1C1C0407, // 0010 EQ R7 R2 R7
0x781E0008, // 0011 JMPF R7 #001B
0xB81E0A00, // 0012 GETNGBL R7 K5
0x8C1C0F06, // 0013 GETMET R7 R7 K6
0x60240008, // 0014 GETGBL R9 G8
0x5C280400, // 0015 MOVE R10 R2
0x7C240200, // 0016 CALL R9 1
0x00260E09, // 0017 ADD R9 K7 R9
0x58280008, // 0018 LDCONST R10 K8
0x7C1C0600, // 0019 CALL R7 3
0x80000E00, // 001A RET 0
0x8C1C0D02, // 001B GETMET R7 R6 K2
0x58240009, // 001C LDCONST R9 K9
0x7C1C0400, // 001D CALL R7 2
0x781E0006, // 001E JMPF R7 #0026
0x601C0017, // 001F GETGBL R7 G23
0x94200D09, // 0020 GETIDX R8 R6 K9
0x7C1C0200, // 0021 CALL R7 1
0x98161207, // 0022 SETIDX R5 K9 R7
0x8C20090A, // 0023 GETMET R8 R4 K10
0x5C280E00, // 0024 MOVE R10 R7
0x7C200400, // 0025 CALL R8 2
0x8C1C0D02, // 0026 GETMET R7 R6 K2
0x5824000B, // 0027 LDCONST R9 K11
0x7C1C0400, // 0028 CALL R7 2
0x781E0013, // 0029 JMPF R7 #003E
0x941C0D0B, // 002A GETIDX R7 R6 K11
0x6020000A, // 002B GETGBL R8 G10
0x94240F0C, // 002C GETIDX R9 R7 K12
0x7C200200, // 002D CALL R8 1
0x6024000A, // 002E GETGBL R9 G10
0x94280F0D, // 002F GETIDX R10 R7 K13
0x7C240200, // 0030 CALL R9 1
0x60280012, // 0031 GETGBL R10 G18
0x7C280000, // 0032 CALL R10 0
0x402C1408, // 0033 CONNECT R11 R10 R8
0x402C1409, // 0034 CONNECT R11 R10 R9
0x9816160A, // 0035 SETIDX R5 K11 R10
0x542AFFFF, // 0036 LDINT R10 65536
0x0820100A, // 0037 MUL R8 R8 R10
0x542AFFFF, // 0038 LDINT R10 65536
0x0824120A, // 0039 MUL R9 R9 R10
0x8C28090E, // 003A GETMET R10 R4 K14
0x5C301000, // 003B MOVE R12 R8
0x5C341200, // 003C MOVE R13 R9
0x7C280600, // 003D CALL R10 3
0x501C0000, // 003E LDBOOL R7 0 0
0x8820090F, // 003F GETMBR R8 R4 K15
0x88240910, // 0040 GETMBR R9 R4 K16
0x8C280D02, // 0041 GETMET R10 R6 K2
0x5830000F, // 0042 LDCONST R12 K15
0x7C280400, // 0043 CALL R10 2
0x782A0009, // 0044 JMPF R10 #004F
0x60280009, // 0045 GETGBL R10 G9
0x942C0D0F, // 0046 GETIDX R11 R6 K15
0x7C280200, // 0047 CALL R10 1
0x5C201400, // 0048 MOVE R8 R10
0x98161E08, // 0049 SETIDX R5 K15 R8
0x542AFFFE, // 004A LDINT R10 65535
0x2428100A, // 004B GT R10 R8 R10
0x782A0000, // 004C JMPF R10 #004E
0x5422FFFE, // 004D LDINT R8 65535
0x501C0200, // 004E LDBOOL R7 1 0
0x8C280D02, // 004F GETMET R10 R6 K2
0x58300010, // 0050 LDCONST R12 K16
0x7C280400, // 0051 CALL R10 2
0x782A000C, // 0052 JMPF R10 #0060
0x60280009, // 0053 GETGBL R10 G9
0x942C0D10, // 0054 GETIDX R11 R6 K16
0x7C280200, // 0055 CALL R10 1
0x5C241400, // 0056 MOVE R9 R10
0x98162009, // 0057 SETIDX R5 K16 R9
0x542A00FD, // 0058 LDINT R10 254
0x2828120A, // 0059 GE R10 R9 R10
0x782A0000, // 005A JMPF R10 #005C
0x542600FE, // 005B LDINT R9 255
0x88280911, // 005C GETMBR R10 R4 K17
0x28281508, // 005D GE R10 R10 K8
0x782A0000, // 005E JMPF R10 #0060
0x501C0200, // 005F LDBOOL R7 1 0
0x781E0003, // 0060 JMPF R7 #0065
0x8C280912, // 0061 GETMET R10 R4 K18
0x5C301000, // 0062 MOVE R12 R8
0x5C341200, // 0063 MOVE R13 R9
0x7C280600, // 0064 CALL R10 3
0x8C280D02, // 0065 GETMET R10 R6 K2
0x58300013, // 0066 LDCONST R12 K19
0x7C280400, // 0067 CALL R10 2
0x782A0006, // 0068 JMPF R10 #0070
0x60280009, // 0069 GETGBL R10 G9
0x942C0D13, // 006A GETIDX R11 R6 K19
0x7C280200, // 006B CALL R10 1
0x9816260A, // 006C SETIDX R5 K19 R10
0x8C2C0914, // 006D GETMET R11 R4 K20
0x5C341400, // 006E MOVE R13 R10
0x7C2C0400, // 006F CALL R11 2
0x8C280D02, // 0070 GETMET R10 R6 K2
0x58300015, // 0071 LDCONST R12 K21
0x7C280400, // 0072 CALL R10 2
0x782A000A, // 0073 JMPF R10 #007F
0x60280009, // 0074 GETGBL R10 G9
0x942C0D15, // 0075 GETIDX R11 R6 K21
0x7C280200, // 0076 CALL R10 1
0x98162A0A, // 0077 SETIDX R5 K21 R10
0x542E00FD, // 0078 LDINT R11 254
0x282C140B, // 0079 GE R11 R10 R11
0x782E0000, // 007A JMPF R11 #007C
0x542A00FE, // 007B LDINT R10 255
0x8C2C0916, // 007C GETMET R11 R4 K22
0x5C341400, // 007D MOVE R13 R10
0x7C2C0400, // 007E CALL R11 2
0x60280012, // 007F GETGBL R10 G18
0x7C280000, // 0080 CALL R10 0
0x602C0010, // 0081 GETGBL R11 G16
0x8C300B17, // 0082 GETMET R12 R5 K23
0x7C300200, // 0083 CALL R12 1
0x7C2C0200, // 0084 CALL R11 1
0xA8020012, // 0085 EXBLK 0 #0099
0x5C301600, // 0086 MOVE R12 R11
0x7C300000, // 0087 CALL R12 0
0x60340008, // 0088 GETGBL R13 G8
0x5C380200, // 0089 MOVE R14 R1
0x7C340200, // 008A CALL R13 1
0x0036300D, // 008B ADD R13 K24 R13
0x00341B19, // 008C ADD R13 R13 K25
0x00341A0C, // 008D ADD R13 R13 R12
0x60380013, // 008E GETGBL R14 G19
0x7C380000, // 008F CALL R14 0
0x603C0013, // 0090 GETGBL R15 G19
0x7C3C0000, // 0091 CALL R15 0
0x94400A0C, // 0092 GETIDX R16 R5 R12
0x983C1A10, // 0093 SETIDX R15 R13 R16
0x983A340F, // 0094 SETIDX R14 K26 R15
0x8C3C151B, // 0095 GETMET R15 R10 K27
0x5C441C00, // 0096 MOVE R17 R14
0x7C3C0400, // 0097 CALL R15 2
0x7001FFEC, // 0098 JMP #0086
0x582C001C, // 0099 LDCONST R11 K28
0xAC2C0200, // 009A CATCH R11 1 0
0xB0080000, // 009B RAISE 2 R0 R0
0x602C000C, // 009C GETGBL R11 G12
0x5C301400, // 009D MOVE R12 R10
0x7C2C0200, // 009E CALL R11 1
0x242C170C, // 009F GT R11 R11 K12
0x782E0001, // 00A0 JMPF R11 #00A3
0x8C2C091D, // 00A1 GETMET R11 R4 K29
0x7C2C0200, // 00A2 CALL R11 1
0x8C2C071E, // 00A3 GETMET R11 R3 K30
0x5C341400, // 00A4 MOVE R13 R10
0x7C2C0400, // 00A5 CALL R11 2
0x80041600, // 00A6 RET 1 R11
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: groups
********************************************************************/
be_local_closure(hue_bridge_monad_groups, /* name */
be_nested_proto(
8, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str(lights),
/* K1 */ be_nested_str(keys),
/* K2 */ be_nested_str(push),
/* K3 */ be_nested_str(_X22),
/* K4 */ be_nested_str(stop_iteration),
/* K5 */ be_const_int(0),
/* K6 */ be_nested_str(concat),
/* K7 */ be_nested_str(_X2C),
}),
&be_const_str_groups,
&be_const_str_solidified,
( &(const binstruction[31]) { /* code */
0x60040012, // 0000 GETGBL R1 G18
0x7C040000, // 0001 CALL R1 0
0x60080010, // 0002 GETGBL R2 G16
0x880C0100, // 0003 GETMBR R3 R0 K0
0x8C0C0701, // 0004 GETMET R3 R3 K1
0x7C0C0200, // 0005 CALL R3 1
0x7C080200, // 0006 CALL R2 1
0xA8020009, // 0007 EXBLK 0 #0012
0x5C0C0400, // 0008 MOVE R3 R2
0x7C0C0000, // 0009 CALL R3 0
0x8C100302, // 000A GETMET R4 R1 K2
0x60180008, // 000B GETGBL R6 G8
0x5C1C0600, // 000C MOVE R7 R3
0x7C180200, // 000D CALL R6 1
0x001A0606, // 000E ADD R6 K3 R6
0x00180D03, // 000F ADD R6 R6 K3
0x7C100400, // 0010 CALL R4 2
0x7001FFF5, // 0011 JMP #0008
0x58080004, // 0012 LDCONST R2 K4
0xAC080200, // 0013 CATCH R2 1 0
0xB0080000, // 0014 RAISE 2 R0 R0
0x6008000C, // 0015 GETGBL R2 G12
0x5C0C0200, // 0016 MOVE R3 R1
0x7C080200, // 0017 CALL R2 1
0x24080505, // 0018 GT R2 R2 K5
0x780A0003, // 0019 JMPF R2 #001E
0x8C080306, // 001A GETMET R2 R1 K6
0x58100007, // 001B LDCONST R4 K7
0x7C080400, // 001C CALL R2 2
0x80040400, // 001D RET 1 R2
0x80000000, // 001E RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: hue_bridge_monad
********************************************************************/
be_local_class(hue_bridge_monad,
1,
NULL,
be_nested_map(10,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(lights, -1), be_const_var(0) },
{ be_const_key(groups, 6), be_const_closure(hue_bridge_monad_groups_closure) },
{ be_const_key(hue_status, -1), be_const_closure(hue_bridge_monad_hue_status_closure) },
{ be_const_key(add_light, -1), be_const_closure(hue_bridge_monad_add_light_closure) },
{ be_const_key(remove_light, 8), be_const_closure(hue_bridge_monad_remove_light_closure) },
{ be_const_key(init, -1), be_const_closure(hue_bridge_monad_init_closure) },
{ be_const_key(cmd, -1), be_const_closure(hue_bridge_monad_cmd_closure) },
{ be_const_key(light_to_id, -1), be_const_closure(hue_bridge_monad_light_to_id_closure) },
{ be_const_key(discover, -1), be_const_closure(hue_bridge_monad_discover_closure) },
{ be_const_key(full_status, 1), be_const_closure(hue_bridge_monad_full_status_closure) },
})),
be_str_weak(hue_bridge_monad)
);
/********************************************************************
** Solidified function: _anonymous_
********************************************************************/
be_local_closure(hue_bridge__anonymous_, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_const_class(be_class_hue_bridge_monad),
}),
&be_const_str__anonymous_,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x58040000, // 0000 LDCONST R1 K0
0xB4000000, // 0001 CLASS K0
0x5C080200, // 0002 MOVE R2 R1
0x7C080000, // 0003 CALL R2 0
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified module: hue_bridge
********************************************************************/
be_local_module(hue_bridge,
"hue_bridge",
be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(hue_bridge__anonymous__closure) },
}))
);
BE_EXPORT_VARIABLE be_define_const_native_module(hue_bridge);
/********************************************************************/
#include "solidify/solidified_hue_bridge.h"
#endif // defined(USE_EMULATION) && defined(USE_EMULATION_HUE)

View File

@ -7,419 +7,4 @@
* name: name of the I2C chip for logging
*
*******************************************************************/
#include "be_constobj.h"
/********************************************************************
** Solidified function: read32
********************************************************************/
be_local_closure(I2C_Driver_read32, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read_bytes),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(0),
/* K4 */ be_const_int(1),
/* K5 */ be_const_int(2),
/* K6 */ be_const_int(3),
}),
&be_const_str_read32,
&be_const_str_solidified,
( &(const binstruction[20]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x541A0003, // 0004 LDINT R6 4
0x7C080800, // 0005 CALL R2 4
0x940C0503, // 0006 GETIDX R3 R2 K3
0x54120017, // 0007 LDINT R4 24
0x380C0604, // 0008 SHL R3 R3 R4
0x94100504, // 0009 GETIDX R4 R2 K4
0x5416000F, // 000A LDINT R5 16
0x38100805, // 000B SHL R4 R4 R5
0x000C0604, // 000C ADD R3 R3 R4
0x94100505, // 000D GETIDX R4 R2 K5
0x54160007, // 000E LDINT R5 8
0x38100805, // 000F SHL R4 R4 R5
0x000C0604, // 0010 ADD R3 R3 R4
0x94100506, // 0011 GETIDX R4 R2 K6
0x000C0604, // 0012 ADD R3 R3 R4
0x80040600, // 0013 RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: write8
********************************************************************/
be_local_closure(I2C_Driver_write8, /* name */
be_nested_proto(
9, /* nstack */
3, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(write),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(1),
}),
&be_const_str_write8,
&be_const_str_solidified,
( &(const binstruction[ 8]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x8C0C0701, // 0001 GETMET R3 R3 K1
0x88140102, // 0002 GETMBR R5 R0 K2
0x5C180200, // 0003 MOVE R6 R1
0x5C1C0400, // 0004 MOVE R7 R2
0x58200003, // 0005 LDCONST R8 K3
0x7C0C0A00, // 0006 CALL R3 5
0x80040600, // 0007 RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read12
********************************************************************/
be_local_closure(I2C_Driver_read12, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read_bytes),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(2),
/* K4 */ be_const_int(0),
/* K5 */ be_const_int(1),
}),
&be_const_str_read12,
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x58180003, // 0004 LDCONST R6 K3
0x7C080800, // 0005 CALL R2 4
0x940C0504, // 0006 GETIDX R3 R2 K4
0x54120003, // 0007 LDINT R4 4
0x380C0604, // 0008 SHL R3 R3 R4
0x94100505, // 0009 GETIDX R4 R2 K5
0x000C0604, // 000A ADD R3 R3 R4
0x80040600, // 000B RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: write_bit
********************************************************************/
be_local_closure(I2C_Driver_write_bit, /* name */
be_nested_proto(
11, /* nstack */
4, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_const_int(0),
/* K1 */ be_const_int(1),
/* K2 */ be_nested_str(write8),
/* K3 */ be_nested_str(read8),
}),
&be_const_str_write_bit,
&be_const_str_solidified,
( &(const binstruction[26]) { /* code */
0x14100500, // 0000 LT R4 R2 K0
0x74120002, // 0001 JMPT R4 #0005
0x54120006, // 0002 LDINT R4 7
0x24100404, // 0003 GT R4 R2 R4
0x78120000, // 0004 JMPF R4 #0006
0x80000800, // 0005 RET 0
0x38120202, // 0006 SHL R4 K1 R2
0x780E0007, // 0007 JMPF R3 #0010
0x8C140102, // 0008 GETMET R5 R0 K2
0x5C1C0200, // 0009 MOVE R7 R1
0x8C200103, // 000A GETMET R8 R0 K3
0x5C280200, // 000B MOVE R10 R1
0x7C200400, // 000C CALL R8 2
0x30201004, // 000D OR R8 R8 R4
0x7C140600, // 000E CALL R5 3
0x70020008, // 000F JMP #0019
0x8C140102, // 0010 GETMET R5 R0 K2
0x5C1C0200, // 0011 MOVE R7 R1
0x8C200103, // 0012 GETMET R8 R0 K3
0x5C280200, // 0013 MOVE R10 R1
0x7C200400, // 0014 CALL R8 2
0x542600FE, // 0015 LDINT R9 255
0x04241204, // 0016 SUB R9 R9 R4
0x2C201009, // 0017 AND R8 R8 R9
0x7C140600, // 0018 CALL R5 3
0x80000000, // 0019 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read24
********************************************************************/
be_local_closure(I2C_Driver_read24, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read_bytes),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(3),
/* K4 */ be_const_int(0),
/* K5 */ be_const_int(1),
/* K6 */ be_const_int(2),
}),
&be_const_str_read24,
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x58180003, // 0004 LDCONST R6 K3
0x7C080800, // 0005 CALL R2 4
0x940C0504, // 0006 GETIDX R3 R2 K4
0x5412000F, // 0007 LDINT R4 16
0x380C0604, // 0008 SHL R3 R3 R4
0x94100505, // 0009 GETIDX R4 R2 K5
0x54160007, // 000A LDINT R5 8
0x38100805, // 000B SHL R4 R4 R5
0x000C0604, // 000C ADD R3 R3 R4
0x94100506, // 000D GETIDX R4 R2 K6
0x000C0604, // 000E ADD R3 R3 R4
0x80040600, // 000F RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read8
********************************************************************/
be_local_closure(I2C_Driver_read8, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(1),
}),
&be_const_str_read8,
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x58180003, // 0004 LDCONST R6 K3
0x7C080800, // 0005 CALL R2 4
0x80040400, // 0006 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(I2C_Driver_init, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str(tasmota),
/* K1 */ be_nested_str(i2c_enabled),
/* K2 */ be_nested_str(addr),
/* K3 */ be_nested_str(wire),
/* K4 */ be_nested_str(wire_scan),
/* K5 */ be_nested_str(function),
/* K6 */ be_nested_str(name),
/* K7 */ be_nested_str(I2C_X3A),
/* K8 */ be_nested_str(detected_X20on_X20bus),
/* K9 */ be_nested_str(bus),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[44]) { /* code */
0x4C100000, // 0000 LDNIL R4
0x20100604, // 0001 NE R4 R3 R4
0x78120005, // 0002 JMPF R4 #0009
0xB8120000, // 0003 GETNGBL R4 K0
0x8C100901, // 0004 GETMET R4 R4 K1
0x5C180600, // 0005 MOVE R6 R3
0x7C100400, // 0006 CALL R4 2
0x74120000, // 0007 JMPT R4 #0009
0x80000800, // 0008 RET 0
0x90020402, // 0009 SETMBR R0 K2 R2
0xB8120000, // 000A GETNGBL R4 K0
0x8C100904, // 000B GETMET R4 R4 K4
0x88180102, // 000C GETMBR R6 R0 K2
0x7C100400, // 000D CALL R4 2
0x90020604, // 000E SETMBR R0 K3 R4
0x88100103, // 000F GETMBR R4 R0 K3
0x78120019, // 0010 JMPF R4 #002B
0x60100004, // 0011 GETGBL R4 G4
0x5C140200, // 0012 MOVE R5 R1
0x7C100200, // 0013 CALL R4 1
0x1C100905, // 0014 EQ R4 R4 K5
0x78120004, // 0015 JMPF R4 #001B
0x5C100200, // 0016 MOVE R4 R1
0x5C140000, // 0017 MOVE R5 R0
0x7C100200, // 0018 CALL R4 1
0x90020C04, // 0019 SETMBR R0 K6 R4
0x70020000, // 001A JMP #001C
0x90020C01, // 001B SETMBR R0 K6 R1
0x88100106, // 001C GETMBR R4 R0 K6
0x4C140000, // 001D LDNIL R5
0x1C100805, // 001E EQ R4 R4 R5
0x78120001, // 001F JMPF R4 #0022
0x4C100000, // 0020 LDNIL R4
0x90020604, // 0021 SETMBR R0 K3 R4
0x88100103, // 0022 GETMBR R4 R0 K3
0x78120006, // 0023 JMPF R4 #002B
0x60100001, // 0024 GETGBL R4 G1
0x58140007, // 0025 LDCONST R5 K7
0x88180106, // 0026 GETMBR R6 R0 K6
0x581C0008, // 0027 LDCONST R7 K8
0x88200103, // 0028 GETMBR R8 R0 K3
0x88201109, // 0029 GETMBR R8 R8 K9
0x7C100800, // 002A CALL R4 4
0x80000000, // 002B RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read13
********************************************************************/
be_local_closure(I2C_Driver_read13, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read_bytes),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(2),
/* K4 */ be_const_int(0),
/* K5 */ be_const_int(1),
}),
&be_const_str_read13,
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x58180003, // 0004 LDCONST R6 K3
0x7C080800, // 0005 CALL R2 4
0x940C0504, // 0006 GETIDX R3 R2 K4
0x54120004, // 0007 LDINT R4 5
0x380C0604, // 0008 SHL R3 R3 R4
0x94100505, // 0009 GETIDX R4 R2 K5
0x000C0604, // 000A ADD R3 R3 R4
0x80040600, // 000B RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: I2C_Driver
********************************************************************/
be_local_class(I2C_Driver,
3,
NULL,
be_nested_map(11,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(read32, -1), be_const_closure(I2C_Driver_read32_closure) },
{ be_const_key(write8, 6), be_const_closure(I2C_Driver_write8_closure) },
{ be_const_key(name, -1), be_const_var(2) },
{ be_const_key(addr, 8), be_const_var(1) },
{ be_const_key(read12, -1), be_const_closure(I2C_Driver_read12_closure) },
{ be_const_key(wire, 10), be_const_var(0) },
{ be_const_key(read13, -1), be_const_closure(I2C_Driver_read13_closure) },
{ be_const_key(read24, -1), be_const_closure(I2C_Driver_read24_closure) },
{ be_const_key(read8, -1), be_const_closure(I2C_Driver_read8_closure) },
{ be_const_key(init, -1), be_const_closure(I2C_Driver_init_closure) },
{ be_const_key(write_bit, -1), be_const_closure(I2C_Driver_write_bit_closure) },
})),
be_str_weak(I2C_Driver)
);
/*******************************************************************/
void be_load_I2C_Driver_class(bvm *vm) {
be_pushntvclass(vm, &be_class_I2C_Driver);
be_setglobal(vm, "I2C_Driver");
be_pop(vm, 1);
}
#include "solidify/solidified_i2c_driver.h"

File diff suppressed because it is too large Load Diff

View File

@ -5,699 +5,4 @@
*
* read power values
*******************************************************************/
#include "be_constobj.h"
/********************************************************************
** Solidified function: json_fdump_map
********************************************************************/
be_local_closure(Persist_json_fdump_map, /* name */
be_nested_proto(
13, /* nstack */
3, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(write),
/* K2 */ be_nested_str(_X7B),
/* K3 */ be_nested_str(keys),
/* K4 */ be_nested_str(dump),
/* K5 */ be_nested_str(_X3A),
/* K6 */ be_nested_str(json_fdump_any),
/* K7 */ be_nested_str(_X2C),
/* K8 */ be_nested_str(stop_iteration),
/* K9 */ be_nested_str(_X7D),
}),
&be_const_str_json_fdump_map,
&be_const_str_solidified,
( &(const binstruction[41]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x8C100301, // 0001 GETMET R4 R1 K1
0x58180002, // 0002 LDCONST R6 K2
0x7C100400, // 0003 CALL R4 2
0x4C100000, // 0004 LDNIL R4
0x60140010, // 0005 GETGBL R5 G16
0x8C180503, // 0006 GETMET R6 R2 K3
0x7C180200, // 0007 CALL R6 1
0x7C140200, // 0008 CALL R5 1
0xA8020017, // 0009 EXBLK 0 #0022
0x5C180A00, // 000A MOVE R6 R5
0x7C180000, // 000B CALL R6 0
0x4C1C0000, // 000C LDNIL R7
0x201C0807, // 000D NE R7 R4 R7
0x781E0002, // 000E JMPF R7 #0012
0x8C1C0301, // 000F GETMET R7 R1 K1
0x5C240800, // 0010 MOVE R9 R4
0x7C1C0400, // 0011 CALL R7 2
0x8C1C0301, // 0012 GETMET R7 R1 K1
0x8C240704, // 0013 GETMET R9 R3 K4
0x602C0008, // 0014 GETGBL R11 G8
0x5C300C00, // 0015 MOVE R12 R6
0x7C2C0200, // 0016 CALL R11 1
0x7C240400, // 0017 CALL R9 2
0x7C1C0400, // 0018 CALL R7 2
0x8C1C0301, // 0019 GETMET R7 R1 K1
0x58240005, // 001A LDCONST R9 K5
0x7C1C0400, // 001B CALL R7 2
0x8C1C0106, // 001C GETMET R7 R0 K6
0x5C240200, // 001D MOVE R9 R1
0x94280406, // 001E GETIDX R10 R2 R6
0x7C1C0600, // 001F CALL R7 3
0x58100007, // 0020 LDCONST R4 K7
0x7001FFE7, // 0021 JMP #000A
0x58140008, // 0022 LDCONST R5 K8
0xAC140200, // 0023 CATCH R5 1 0
0xB0080000, // 0024 RAISE 2 R0 R0
0x8C140301, // 0025 GETMET R5 R1 K1
0x581C0009, // 0026 LDCONST R7 K9
0x7C140400, // 0027 CALL R5 2
0x80000000, // 0028 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: setmember
********************************************************************/
be_local_closure(Persist_setmember, /* name */
be_nested_proto(
4, /* nstack */
3, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(_dirty),
}),
&be_const_str_setmember,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x980C0202, // 0001 SETIDX R3 R1 R2
0x500C0200, // 0002 LDBOOL R3 1 0
0x90020203, // 0003 SETMBR R0 K1 R3
0x80000000, // 0004 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: zero
********************************************************************/
be_local_closure(Persist_zero, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(_dirty),
}),
&be_const_str_zero,
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x60040013, // 0000 GETGBL R1 G19
0x7C040000, // 0001 CALL R1 0
0x90020001, // 0002 SETMBR R0 K0 R1
0x50040200, // 0003 LDBOOL R1 1 0
0x90020201, // 0004 SETMBR R0 K1 R1
0x80000000, // 0005 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: member
********************************************************************/
be_local_closure(Persist_member, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(find),
}),
&be_const_str_member,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: json_fdump
********************************************************************/
be_local_closure(Persist_json_fdump, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(_p),
/* K2 */ be_nested_str(json_fdump_map),
/* K3 */ be_nested_str(internal_error),
/* K4 */ be_nested_str(persist_X2E_p_X20is_X20not_X20a_X20map),
}),
&be_const_str_json_fdump,
&be_const_str_solidified,
( &(const binstruction[13]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
0x600C000F, // 0001 GETGBL R3 G15
0x88100101, // 0002 GETMBR R4 R0 K1
0x60140013, // 0003 GETGBL R5 G19
0x7C0C0400, // 0004 CALL R3 2
0x780E0004, // 0005 JMPF R3 #000B
0x8C0C0102, // 0006 GETMET R3 R0 K2
0x5C140200, // 0007 MOVE R5 R1
0x88180101, // 0008 GETMBR R6 R0 K1
0x7C0C0600, // 0009 CALL R3 3
0x70020000, // 000A JMP #000C
0xB0060704, // 000B RAISE 1 K3 K4
0x80000000, // 000C RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: remove
********************************************************************/
be_local_closure(Persist_remove, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(remove),
/* K2 */ be_nested_str(_dirty),
}),
&be_const_str_remove,
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x50080200, // 0004 LDBOOL R2 1 0
0x90020402, // 0005 SETMBR R0 K2 R2
0x80000000, // 0006 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: json_fdump_any
********************************************************************/
be_local_closure(Persist_json_fdump_any, /* name */
be_nested_proto(
9, /* nstack */
3, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(json_fdump_map),
/* K2 */ be_nested_str(json_fdump_list),
/* K3 */ be_nested_str(write),
/* K4 */ be_nested_str(dump),
}),
&be_const_str_json_fdump_any,
&be_const_str_solidified,
( &(const binstruction[27]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x6010000F, // 0001 GETGBL R4 G15
0x5C140400, // 0002 MOVE R5 R2
0x60180013, // 0003 GETGBL R6 G19
0x7C100400, // 0004 CALL R4 2
0x78120004, // 0005 JMPF R4 #000B
0x8C100101, // 0006 GETMET R4 R0 K1
0x5C180200, // 0007 MOVE R6 R1
0x5C1C0400, // 0008 MOVE R7 R2
0x7C100600, // 0009 CALL R4 3
0x7002000E, // 000A JMP #001A
0x6010000F, // 000B GETGBL R4 G15
0x5C140400, // 000C MOVE R5 R2
0x60180012, // 000D GETGBL R6 G18
0x7C100400, // 000E CALL R4 2
0x78120004, // 000F JMPF R4 #0015
0x8C100102, // 0010 GETMET R4 R0 K2
0x5C180200, // 0011 MOVE R6 R1
0x5C1C0400, // 0012 MOVE R7 R2
0x7C100600, // 0013 CALL R4 3
0x70020004, // 0014 JMP #001A
0x8C100303, // 0015 GETMET R4 R1 K3
0x8C180704, // 0016 GETMET R6 R3 K4
0x5C200400, // 0017 MOVE R8 R2
0x7C180400, // 0018 CALL R6 2
0x7C100400, // 0019 CALL R4 2
0x80000000, // 001A RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: save
********************************************************************/
be_local_closure(Persist_save, /* name */
be_nested_proto(
7, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str(_filename),
/* K1 */ be_nested_str(w),
/* K2 */ be_nested_str(json_fdump),
/* K3 */ be_nested_str(close),
/* K4 */ be_nested_str(write),
/* K5 */ be_nested_str(_X7B_X7D),
/* K6 */ be_nested_str(_dirty),
}),
&be_const_str_save,
&be_const_str_solidified,
( &(const binstruction[37]) { /* code */
0x4C040000, // 0000 LDNIL R1
0xA802000B, // 0001 EXBLK 0 #000E
0x60080011, // 0002 GETGBL R2 G17
0x880C0100, // 0003 GETMBR R3 R0 K0
0x58100001, // 0004 LDCONST R4 K1
0x7C080400, // 0005 CALL R2 2
0x5C040400, // 0006 MOVE R1 R2
0x8C080102, // 0007 GETMET R2 R0 K2
0x5C100200, // 0008 MOVE R4 R1
0x7C080400, // 0009 CALL R2 2
0x8C080303, // 000A GETMET R2 R1 K3
0x7C080200, // 000B CALL R2 1
0xA8040001, // 000C EXBLK 1 1
0x70020013, // 000D JMP #0022
0xAC080002, // 000E CATCH R2 0 2
0x70020010, // 000F JMP #0021
0x4C100000, // 0010 LDNIL R4
0x20100204, // 0011 NE R4 R1 R4
0x78120001, // 0012 JMPF R4 #0015
0x8C100303, // 0013 GETMET R4 R1 K3
0x7C100200, // 0014 CALL R4 1
0x60100011, // 0015 GETGBL R4 G17
0x88140100, // 0016 GETMBR R5 R0 K0
0x58180001, // 0017 LDCONST R6 K1
0x7C100400, // 0018 CALL R4 2
0x5C040800, // 0019 MOVE R1 R4
0x8C100304, // 001A GETMET R4 R1 K4
0x58180005, // 001B LDCONST R6 K5
0x7C100400, // 001C CALL R4 2
0x8C100303, // 001D GETMET R4 R1 K3
0x7C100200, // 001E CALL R4 1
0xB0040403, // 001F RAISE 1 R2 R3
0x70020000, // 0020 JMP #0022
0xB0080000, // 0021 RAISE 2 R0 R0
0x50080000, // 0022 LDBOOL R2 0 0
0x90020C02, // 0023 SETMBR R0 K6 R2
0x80000000, // 0024 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: load
********************************************************************/
be_local_closure(Persist_load, /* name */
be_nested_proto(
9, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[12]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(path),
/* K2 */ be_nested_str(exists),
/* K3 */ be_nested_str(_filename),
/* K4 */ be_nested_str(r),
/* K5 */ be_nested_str(load),
/* K6 */ be_nested_str(read),
/* K7 */ be_nested_str(close),
/* K8 */ be_nested_str(_p),
/* K9 */ be_nested_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson),
/* K10 */ be_nested_str(_dirty),
/* K11 */ be_nested_str(save),
}),
&be_const_str_load,
&be_const_str_solidified,
( &(const binstruction[49]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
0xA40A0200, // 0001 IMPORT R2 K1
0x4C0C0000, // 0002 LDNIL R3
0x4C100000, // 0003 LDNIL R4
0x8C140502, // 0004 GETMET R5 R2 K2
0x881C0103, // 0005 GETMBR R7 R0 K3
0x7C140400, // 0006 CALL R5 2
0x78160025, // 0007 JMPF R5 #002E
0xA802000D, // 0008 EXBLK 0 #0017
0x60140011, // 0009 GETGBL R5 G17
0x88180103, // 000A GETMBR R6 R0 K3
0x581C0004, // 000B LDCONST R7 K4
0x7C140400, // 000C CALL R5 2
0x5C0C0A00, // 000D MOVE R3 R5
0x8C140305, // 000E GETMET R5 R1 K5
0x8C1C0706, // 000F GETMET R7 R3 K6
0x7C1C0200, // 0010 CALL R7 1
0x7C140400, // 0011 CALL R5 2
0x5C100A00, // 0012 MOVE R4 R5
0x8C140707, // 0013 GETMET R5 R3 K7
0x7C140200, // 0014 CALL R5 1
0xA8040001, // 0015 EXBLK 1 1
0x70020009, // 0016 JMP #0021
0xAC140002, // 0017 CATCH R5 0 2
0x70020006, // 0018 JMP #0020
0x4C1C0000, // 0019 LDNIL R7
0x201C0607, // 001A NE R7 R3 R7
0x781E0001, // 001B JMPF R7 #001E
0x8C1C0707, // 001C GETMET R7 R3 K7
0x7C1C0200, // 001D CALL R7 1
0xB0040A06, // 001E RAISE 1 R5 R6
0x70020000, // 001F JMP #0021
0xB0080000, // 0020 RAISE 2 R0 R0
0x6014000F, // 0021 GETGBL R5 G15
0x5C180800, // 0022 MOVE R6 R4
0x601C0013, // 0023 GETGBL R7 G19
0x7C140400, // 0024 CALL R5 2
0x78160001, // 0025 JMPF R5 #0028
0x90021004, // 0026 SETMBR R0 K8 R4
0x70020002, // 0027 JMP #002B
0x60140001, // 0028 GETGBL R5 G1
0x58180009, // 0029 LDCONST R6 K9
0x7C140200, // 002A CALL R5 1
0x50140000, // 002B LDBOOL R5 0 0
0x90021405, // 002C SETMBR R0 K10 R5
0x70020001, // 002D JMP #0030
0x8C14010B, // 002E GETMET R5 R0 K11
0x7C140200, // 002F CALL R5 1
0x80000000, // 0030 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: find
********************************************************************/
be_local_closure(Persist_find, /* name */
be_nested_proto(
7, /* nstack */
3, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(find),
}),
&be_const_str_find,
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x8C0C0701, // 0001 GETMET R3 R3 K1
0x5C140200, // 0002 MOVE R5 R1
0x5C180400, // 0003 MOVE R6 R2
0x7C0C0600, // 0004 CALL R3 3
0x80040600, // 0005 RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Persist_init, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str(_filename),
/* K1 */ be_nested_str(_persist_X2Ejson),
/* K2 */ be_nested_str(_p),
/* K3 */ be_nested_str(copy),
/* K4 */ be_nested_str(load),
/* K5 */ be_nested_str(_dirty),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[20]) { /* code */
0x90020101, // 0000 SETMBR R0 K0 K1
0x6008000F, // 0001 GETGBL R2 G15
0x5C0C0200, // 0002 MOVE R3 R1
0x60100013, // 0003 GETGBL R4 G19
0x7C080400, // 0004 CALL R2 2
0x780A0003, // 0005 JMPF R2 #000A
0x8C080303, // 0006 GETMET R2 R1 K3
0x7C080200, // 0007 CALL R2 1
0x90020402, // 0008 SETMBR R0 K2 R2
0x70020002, // 0009 JMP #000D
0x60080013, // 000A GETGBL R2 G19
0x7C080000, // 000B CALL R2 0
0x90020402, // 000C SETMBR R0 K2 R2
0x8C080104, // 000D GETMET R2 R0 K4
0x88100102, // 000E GETMBR R4 R0 K2
0x88140100, // 000F GETMBR R5 R0 K0
0x7C080600, // 0010 CALL R2 3
0x50080000, // 0011 LDBOOL R2 0 0
0x90020A02, // 0012 SETMBR R0 K5 R2
0x80000000, // 0013 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: json_fdump_list
********************************************************************/
be_local_closure(Persist_json_fdump_list, /* name */
be_nested_proto(
9, /* nstack */
3, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(write),
/* K2 */ be_nested_str(_X5B),
/* K3 */ be_const_int(0),
/* K4 */ be_nested_str(_X2C),
/* K5 */ be_nested_str(json_fdump_any),
/* K6 */ be_const_int(1),
/* K7 */ be_nested_str(_X5D),
}),
&be_const_str_json_fdump_list,
&be_const_str_solidified,
( &(const binstruction[25]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x8C100301, // 0001 GETMET R4 R1 K1
0x58180002, // 0002 LDCONST R6 K2
0x7C100400, // 0003 CALL R4 2
0x58100003, // 0004 LDCONST R4 K3
0x6014000C, // 0005 GETGBL R5 G12
0x5C180400, // 0006 MOVE R6 R2
0x7C140200, // 0007 CALL R5 1
0x14140805, // 0008 LT R5 R4 R5
0x7816000A, // 0009 JMPF R5 #0015
0x24140903, // 000A GT R5 R4 K3
0x78160002, // 000B JMPF R5 #000F
0x8C140301, // 000C GETMET R5 R1 K1
0x581C0004, // 000D LDCONST R7 K4
0x7C140400, // 000E CALL R5 2
0x8C140105, // 000F GETMET R5 R0 K5
0x5C1C0200, // 0010 MOVE R7 R1
0x94200404, // 0011 GETIDX R8 R2 R4
0x7C140600, // 0012 CALL R5 3
0x00100906, // 0013 ADD R4 R4 K6
0x7001FFEF, // 0014 JMP #0005
0x8C140301, // 0015 GETMET R5 R1 K1
0x581C0007, // 0016 LDCONST R7 K7
0x7C140400, // 0017 CALL R5 2
0x80000000, // 0018 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: has
********************************************************************/
be_local_closure(Persist_has, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(has),
}),
&be_const_str_has,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Persist
********************************************************************/
be_local_class(Persist,
3,
NULL,
be_nested_map(16,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(has, 6), be_const_closure(Persist_has_closure) },
{ be_const_key(setmember, -1), be_const_closure(Persist_setmember_closure) },
{ be_const_key(remove, -1), be_const_closure(Persist_remove_closure) },
{ be_const_key(zero, 0), be_const_closure(Persist_zero_closure) },
{ be_const_key(json_fdump, -1), be_const_closure(Persist_json_fdump_closure) },
{ be_const_key(json_fdump_list, 2), be_const_closure(Persist_json_fdump_list_closure) },
{ be_const_key(init, 15), be_const_closure(Persist_init_closure) },
{ be_const_key(find, -1), be_const_closure(Persist_find_closure) },
{ be_const_key(save, -1), be_const_closure(Persist_save_closure) },
{ be_const_key(json_fdump_any, 12), be_const_closure(Persist_json_fdump_any_closure) },
{ be_const_key(_p, 7), be_const_var(1) },
{ be_const_key(_filename, -1), be_const_var(0) },
{ be_const_key(load, -1), be_const_closure(Persist_load_closure) },
{ be_const_key(json_fdump_map, 5), be_const_closure(Persist_json_fdump_map_closure) },
{ be_const_key(_dirty, -1), be_const_var(2) },
{ be_const_key(member, -1), be_const_closure(Persist_member_closure) },
})),
be_str_weak(Persist)
);
/********************************************************************
** Solidified function: _anonymous_
********************************************************************/
be_local_closure(persist__anonymous_, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_const_class(be_class_Persist),
}),
&be_const_str__anonymous_,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x58040000, // 0000 LDCONST R1 K0
0xB4000000, // 0001 CLASS K0
0x5C080200, // 0002 MOVE R2 R1
0x7C080000, // 0003 CALL R2 0
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified module: persist
********************************************************************/
be_local_module(persist,
"persist",
be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(persist__anonymous__closure) },
}))
);
BE_EXPORT_VARIABLE be_define_const_native_module(persist);
/********************************************************************/
#include "solidify/solidified_persist.h"

View File

@ -2,76 +2,4 @@
* uuid module
*
*******************************************************************/
#include "be_constobj.h"
/********************************************************************
** Solidified function: _anonymous_
********************************************************************/
be_local_closure(uuid__anonymous_, /* name */
be_nested_proto(
12, /* nstack */
0, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str(string),
/* K1 */ be_nested_str(math),
/* K2 */ be_nested_str(format),
/* K3 */ be_nested_str(_X2508x_X2D_X2504x_X2D_X2504x_X2D_X2504x_X2D_X2504x_X2508x),
/* K4 */ be_nested_str(rand),
}),
&be_const_str__anonymous_,
&be_const_str_solidified,
( &(const binstruction[30]) { /* code */
0xA4020000, // 0000 IMPORT R0 K0
0xA4060200, // 0001 IMPORT R1 K1
0x8C080102, // 0002 GETMET R2 R0 K2
0x58100003, // 0003 LDCONST R4 K3
0x8C140304, // 0004 GETMET R5 R1 K4
0x7C140200, // 0005 CALL R5 1
0x8C180304, // 0006 GETMET R6 R1 K4
0x7C180200, // 0007 CALL R6 1
0x541EFFFE, // 0008 LDINT R7 65535
0x2C180C07, // 0009 AND R6 R6 R7
0x8C1C0304, // 000A GETMET R7 R1 K4
0x7C1C0200, // 000B CALL R7 1
0x54220FFE, // 000C LDINT R8 4095
0x2C1C0E08, // 000D AND R7 R7 R8
0x54223FFF, // 000E LDINT R8 16384
0x301C0E08, // 000F OR R7 R7 R8
0x8C200304, // 0010 GETMET R8 R1 K4
0x7C200200, // 0011 CALL R8 1
0x54263FFE, // 0012 LDINT R9 16383
0x2C201009, // 0013 AND R8 R8 R9
0x54267FFF, // 0014 LDINT R9 32768
0x30201009, // 0015 OR R8 R8 R9
0x8C240304, // 0016 GETMET R9 R1 K4
0x7C240200, // 0017 CALL R9 1
0x542AFFFE, // 0018 LDINT R10 65535
0x2C24120A, // 0019 AND R9 R9 R10
0x8C280304, // 001A GETMET R10 R1 K4
0x7C280200, // 001B CALL R10 1
0x7C081000, // 001C CALL R2 8
0x80040400, // 001D RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified module: uuid
********************************************************************/
be_local_module(uuid,
"uuid",
be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(uuid4, -1), be_const_closure(uuid__anonymous__closure) },
}))
);
BE_EXPORT_VARIABLE be_define_const_native_module(uuid);
/********************************************************************/
#include "solidify/solidified_uuid.h"

View File

@ -1,6 +1,8 @@
# class containing all registered Alexa/Hue lights
#
# simulates a Hue bridge containing multiple lights
#@ solidify:hue_bridge
var hue_bridge = module("hue_bridge")
hue_bridge.init = def (m)

View File

@ -13,7 +13,8 @@
- addr: I2C address of device, will probe all I2C buses for it
- i2c_index: (optional) check is the device is not disabled
-------------------------------------------------------------#
#@ solidify:I2C_Driver
class I2C_Driver
var wire #- wire object to reach the device, if nil then the module is not initialized -#
var addr #- I2C address of the device -#

View File

@ -10,6 +10,7 @@
# Provides low-level objects and a Web UI
#######################################################################
#@ solidify:partition_core
var partition_core = module('partition_core')
#######################################################################

View File

@ -7,6 +7,7 @@
solidify.dump(persist_module.init)
# copy and paste into `be_persist_lib.c`
-#
#@ solidify:persist_module
var persist_module = module("persist")
persist_module.init = def (m)

View File

@ -1,4 +1,4 @@
#@ solidify:uuid
uuid = module("uuid")
uuid.uuid4 = def ()
import string

View File

@ -0,0 +1,714 @@
/* Solidification of hue_bridge.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
/********************************************************************
** Solidified function: full_status
********************************************************************/
be_local_closure(hue_bridge_monad_full_status, /* name */
be_nested_proto(
11, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str(hue_ntv),
/* K1 */ be_nested_str(lights),
/* K2 */ be_nested_str(contains),
/* K3 */ be_nested_str(full_state),
/* K4 */ be_nested_str(light),
/* K5 */ be_nested_str(name),
/* K6 */ be_nested_str(model),
/* K7 */ be_nested_str(manuf),
}),
&be_const_str_full_status,
&be_const_str_solidified,
( &(const binstruction[17]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
0x880C0101, // 0001 GETMBR R3 R0 K1
0x8C0C0702, // 0002 GETMET R3 R3 K2
0x5C140200, // 0003 MOVE R5 R1
0x7C0C0400, // 0004 CALL R3 2
0x780E0009, // 0005 JMPF R3 #0010
0x880C0101, // 0006 GETMBR R3 R0 K1
0x940C0601, // 0007 GETIDX R3 R3 R1
0x8C100503, // 0008 GETMET R4 R2 K3
0x5C180200, // 0009 MOVE R6 R1
0x941C0704, // 000A GETIDX R7 R3 K4
0x94200705, // 000B GETIDX R8 R3 K5
0x94240706, // 000C GETIDX R9 R3 K6
0x94280707, // 000D GETIDX R10 R3 K7
0x7C100C00, // 000E CALL R4 6
0x80040800, // 000F RET 1 R4
0x80000000, // 0010 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: hue_status
********************************************************************/
be_local_closure(hue_bridge_monad_hue_status, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str(hue_ntv),
/* K1 */ be_nested_str(lights),
/* K2 */ be_nested_str(contains),
/* K3 */ be_nested_str(light_state),
/* K4 */ be_nested_str(light),
}),
&be_const_str_hue_status,
&be_const_str_solidified,
( &(const binstruction[13]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
0x880C0101, // 0001 GETMBR R3 R0 K1
0x8C0C0702, // 0002 GETMET R3 R3 K2
0x5C140200, // 0003 MOVE R5 R1
0x7C0C0400, // 0004 CALL R3 2
0x780E0005, // 0005 JMPF R3 #000C
0x8C0C0503, // 0006 GETMET R3 R2 K3
0x88140101, // 0007 GETMBR R5 R0 K1
0x94140A01, // 0008 GETIDX R5 R5 R1
0x94140B04, // 0009 GETIDX R5 R5 K4
0x7C0C0400, // 000A CALL R3 2
0x80040600, // 000B RET 1 R3
0x80000000, // 000C RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: add_light
********************************************************************/
be_local_closure(hue_bridge_monad_add_light, /* name */
be_nested_proto(
10, /* nstack */
6, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[14]) { /* constants */
/* K0 */ be_nested_str(int),
/* K1 */ be_nested_str(value_error),
/* K2 */ be_nested_str(id_X20must_X20be_X20of_X20type_X20_X27int_X27),
/* K3 */ be_nested_str(light_state),
/* K4 */ be_nested_str(light_X20must_X20be_X20of_X20class_X20_X27light_state_X27),
/* K5 */ be_const_int(0),
/* K6 */ be_nested_str(missing_X20name),
/* K7 */ be_nested_str(Unknown),
/* K8 */ be_nested_str(Tasmota),
/* K9 */ be_nested_str(lights),
/* K10 */ be_nested_str(light),
/* K11 */ be_nested_str(name),
/* K12 */ be_nested_str(model),
/* K13 */ be_nested_str(manuf),
}),
&be_const_str_add_light,
&be_const_str_solidified,
( &(const binstruction[43]) { /* code */
0x60180004, // 0000 GETGBL R6 G4
0x5C1C0200, // 0001 MOVE R7 R1
0x7C180200, // 0002 CALL R6 1
0x20180D00, // 0003 NE R6 R6 K0
0x781A0000, // 0004 JMPF R6 #0006
0xB0060302, // 0005 RAISE 1 K1 K2
0x6018000F, // 0006 GETGBL R6 G15
0x5C1C0400, // 0007 MOVE R7 R2
0xB8220600, // 0008 GETNGBL R8 K3
0x7C180400, // 0009 CALL R6 2
0x741A0000, // 000A JMPT R6 #000C
0xB0060304, // 000B RAISE 1 K1 K4
0x60180008, // 000C GETGBL R6 G8
0x5C1C0600, // 000D MOVE R7 R3
0x7C180200, // 000E CALL R6 1
0x5C0C0C00, // 000F MOVE R3 R6
0x6018000C, // 0010 GETGBL R6 G12
0x5C1C0600, // 0011 MOVE R7 R3
0x7C180200, // 0012 CALL R6 1
0x1C180D05, // 0013 EQ R6 R6 K5
0x781A0000, // 0014 JMPF R6 #0016
0xB0060306, // 0015 RAISE 1 K1 K6
0x5C180800, // 0016 MOVE R6 R4
0x741A0000, // 0017 JMPT R6 #0019
0x58100007, // 0018 LDCONST R4 K7
0x5C180A00, // 0019 MOVE R6 R5
0x741A0000, // 001A JMPT R6 #001C
0x58140008, // 001B LDCONST R5 K8
0x88180109, // 001C GETMBR R6 R0 K9
0x601C0013, // 001D GETGBL R7 G19
0x7C1C0000, // 001E CALL R7 0
0x981E1402, // 001F SETIDX R7 K10 R2
0x981E1603, // 0020 SETIDX R7 K11 R3
0x60200008, // 0021 GETGBL R8 G8
0x5C240800, // 0022 MOVE R9 R4
0x7C200200, // 0023 CALL R8 1
0x981E1808, // 0024 SETIDX R7 K12 R8
0x60200008, // 0025 GETGBL R8 G8
0x5C240A00, // 0026 MOVE R9 R5
0x7C200200, // 0027 CALL R8 1
0x981E1A08, // 0028 SETIDX R7 K13 R8
0x98180207, // 0029 SETIDX R6 R1 R7
0x80000000, // 002A RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: remove_light
********************************************************************/
be_local_closure(hue_bridge_monad_remove_light, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(lights),
/* K1 */ be_nested_str(remove),
}),
&be_const_str_remove_light,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x80000000, // 0004 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(hue_bridge_monad_init, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str(lights),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[ 4]) { /* code */
0x60040013, // 0000 GETGBL R1 G19
0x7C040000, // 0001 CALL R1 0
0x90020001, // 0002 SETMBR R0 K0 R1
0x80000000, // 0003 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: discover
********************************************************************/
be_local_closure(hue_bridge_monad_discover, /* name */
be_nested_proto(
11, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[13]) { /* constants */
/* K0 */ be_nested_str(hue_ntv),
/* K1 */ be_nested_str(json),
/* K2 */ be_nested_str(string),
/* K3 */ be_nested_str(lights),
/* K4 */ be_nested_str(keys),
/* K5 */ be_nested_str(full_status),
/* K6 */ be_nested_str(_X22),
/* K7 */ be_nested_str(_X22_X3A),
/* K8 */ be_nested_str(push),
/* K9 */ be_nested_str(stop_iteration),
/* K10 */ be_const_int(0),
/* K11 */ be_nested_str(concat),
/* K12 */ be_nested_str(_X2C),
}),
&be_const_str_discover,
&be_const_str_solidified,
( &(const binstruction[40]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
0xA40A0200, // 0001 IMPORT R2 K1
0xA40E0400, // 0002 IMPORT R3 K2
0x60100012, // 0003 GETGBL R4 G18
0x7C100000, // 0004 CALL R4 0
0x60140010, // 0005 GETGBL R5 G16
0x88180103, // 0006 GETMBR R6 R0 K3
0x8C180D04, // 0007 GETMET R6 R6 K4
0x7C180200, // 0008 CALL R6 1
0x7C140200, // 0009 CALL R5 1
0xA802000F, // 000A EXBLK 0 #001B
0x5C180A00, // 000B MOVE R6 R5
0x7C180000, // 000C CALL R6 0
0x8C1C0105, // 000D GETMET R7 R0 K5
0x5C240C00, // 000E MOVE R9 R6
0x7C1C0400, // 000F CALL R7 2
0x781E0008, // 0010 JMPF R7 #001A
0x60200008, // 0011 GETGBL R8 G8
0x5C240C00, // 0012 MOVE R9 R6
0x7C200200, // 0013 CALL R8 1
0x00220C08, // 0014 ADD R8 K6 R8
0x00201107, // 0015 ADD R8 R8 K7
0x001C1007, // 0016 ADD R7 R8 R7
0x8C200908, // 0017 GETMET R8 R4 K8
0x5C280E00, // 0018 MOVE R10 R7
0x7C200400, // 0019 CALL R8 2
0x7001FFEF, // 001A JMP #000B
0x58140009, // 001B LDCONST R5 K9
0xAC140200, // 001C CATCH R5 1 0
0xB0080000, // 001D RAISE 2 R0 R0
0x6014000C, // 001E GETGBL R5 G12
0x5C180800, // 001F MOVE R6 R4
0x7C140200, // 0020 CALL R5 1
0x24140B0A, // 0021 GT R5 R5 K10
0x78160003, // 0022 JMPF R5 #0027
0x8C14090B, // 0023 GETMET R5 R4 K11
0x581C000C, // 0024 LDCONST R7 K12
0x7C140400, // 0025 CALL R5 2
0x80040A00, // 0026 RET 1 R5
0x80000000, // 0027 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: light_to_id
********************************************************************/
be_local_closure(hue_bridge_monad_light_to_id, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str(lights),
/* K1 */ be_nested_str(keys),
/* K2 */ be_nested_str(light),
/* K3 */ be_nested_str(stop_iteration),
}),
&be_const_str_light_to_id,
&be_const_str_solidified,
( &(const binstruction[20]) { /* code */
0x60080010, // 0000 GETGBL R2 G16
0x880C0100, // 0001 GETMBR R3 R0 K0
0x8C0C0701, // 0002 GETMET R3 R3 K1
0x7C0C0200, // 0003 CALL R3 1
0x7C080200, // 0004 CALL R2 1
0xA8020009, // 0005 EXBLK 0 #0010
0x5C0C0400, // 0006 MOVE R3 R2
0x7C0C0000, // 0007 CALL R3 0
0x88100100, // 0008 GETMBR R4 R0 K0
0x94100803, // 0009 GETIDX R4 R4 R3
0x94100902, // 000A GETIDX R4 R4 K2
0x1C100204, // 000B EQ R4 R1 R4
0x78120001, // 000C JMPF R4 #000F
0xA8040001, // 000D EXBLK 1 1
0x80040600, // 000E RET 1 R3
0x7001FFF5, // 000F JMP #0006
0x58080003, // 0010 LDCONST R2 K3
0xAC080200, // 0011 CATCH R2 1 0
0xB0080000, // 0012 RAISE 2 R0 R0
0x80000000, // 0013 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: cmd
********************************************************************/
be_local_closure(hue_bridge_monad_cmd, /* name */
be_nested_proto(
18, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[31]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(lights),
/* K2 */ be_nested_str(contains),
/* K3 */ be_nested_str(light),
/* K4 */ be_nested_str(load),
/* K5 */ be_nested_str(tasmota),
/* K6 */ be_nested_str(log),
/* K7 */ be_nested_str(BRY_X3A_X20invalid_X20hue_X20payload_X3A_X20),
/* K8 */ be_const_int(3),
/* K9 */ be_nested_str(on),
/* K10 */ be_nested_str(set_power),
/* K11 */ be_nested_str(xy),
/* K12 */ be_const_int(0),
/* K13 */ be_const_int(1),
/* K14 */ be_nested_str(set_xy),
/* K15 */ be_nested_str(hue),
/* K16 */ be_nested_str(sat),
/* K17 */ be_nested_str(type),
/* K18 */ be_nested_str(set_hue16sat),
/* K19 */ be_nested_str(ct),
/* K20 */ be_nested_str(set_ct),
/* K21 */ be_nested_str(bri),
/* K22 */ be_nested_str(set_bri),
/* K23 */ be_nested_str(keys),
/* K24 */ be_nested_str(_X2Flights_X2F),
/* K25 */ be_nested_str(_X2Fstate_X2F),
/* K26 */ be_nested_str(success),
/* K27 */ be_nested_str(push),
/* K28 */ be_nested_str(stop_iteration),
/* K29 */ be_nested_str(signal_change),
/* K30 */ be_nested_str(dump),
}),
&be_const_str_cmd,
&be_const_str_solidified,
( &(const binstruction[167]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x88100101, // 0001 GETMBR R4 R0 K1
0x8C100902, // 0002 GETMET R4 R4 K2
0x5C180200, // 0003 MOVE R6 R1
0x7C100400, // 0004 CALL R4 2
0x74120000, // 0005 JMPT R4 #0007
0x80000800, // 0006 RET 0
0x88100101, // 0007 GETMBR R4 R0 K1
0x94100801, // 0008 GETIDX R4 R4 R1
0x94100903, // 0009 GETIDX R4 R4 K3
0x60140013, // 000A GETGBL R5 G19
0x7C140000, // 000B CALL R5 0
0x8C180704, // 000C GETMET R6 R3 K4
0x5C200400, // 000D MOVE R8 R2
0x7C180400, // 000E CALL R6 2
0x4C1C0000, // 000F LDNIL R7
0x1C1C0407, // 0010 EQ R7 R2 R7
0x781E0008, // 0011 JMPF R7 #001B
0xB81E0A00, // 0012 GETNGBL R7 K5
0x8C1C0F06, // 0013 GETMET R7 R7 K6
0x60240008, // 0014 GETGBL R9 G8
0x5C280400, // 0015 MOVE R10 R2
0x7C240200, // 0016 CALL R9 1
0x00260E09, // 0017 ADD R9 K7 R9
0x58280008, // 0018 LDCONST R10 K8
0x7C1C0600, // 0019 CALL R7 3
0x80000E00, // 001A RET 0
0x8C1C0D02, // 001B GETMET R7 R6 K2
0x58240009, // 001C LDCONST R9 K9
0x7C1C0400, // 001D CALL R7 2
0x781E0006, // 001E JMPF R7 #0026
0x601C0017, // 001F GETGBL R7 G23
0x94200D09, // 0020 GETIDX R8 R6 K9
0x7C1C0200, // 0021 CALL R7 1
0x98161207, // 0022 SETIDX R5 K9 R7
0x8C20090A, // 0023 GETMET R8 R4 K10
0x5C280E00, // 0024 MOVE R10 R7
0x7C200400, // 0025 CALL R8 2
0x8C1C0D02, // 0026 GETMET R7 R6 K2
0x5824000B, // 0027 LDCONST R9 K11
0x7C1C0400, // 0028 CALL R7 2
0x781E0013, // 0029 JMPF R7 #003E
0x941C0D0B, // 002A GETIDX R7 R6 K11
0x6020000A, // 002B GETGBL R8 G10
0x94240F0C, // 002C GETIDX R9 R7 K12
0x7C200200, // 002D CALL R8 1
0x6024000A, // 002E GETGBL R9 G10
0x94280F0D, // 002F GETIDX R10 R7 K13
0x7C240200, // 0030 CALL R9 1
0x60280012, // 0031 GETGBL R10 G18
0x7C280000, // 0032 CALL R10 0
0x402C1408, // 0033 CONNECT R11 R10 R8
0x402C1409, // 0034 CONNECT R11 R10 R9
0x9816160A, // 0035 SETIDX R5 K11 R10
0x542AFFFF, // 0036 LDINT R10 65536
0x0820100A, // 0037 MUL R8 R8 R10
0x542AFFFF, // 0038 LDINT R10 65536
0x0824120A, // 0039 MUL R9 R9 R10
0x8C28090E, // 003A GETMET R10 R4 K14
0x5C301000, // 003B MOVE R12 R8
0x5C341200, // 003C MOVE R13 R9
0x7C280600, // 003D CALL R10 3
0x501C0000, // 003E LDBOOL R7 0 0
0x8820090F, // 003F GETMBR R8 R4 K15
0x88240910, // 0040 GETMBR R9 R4 K16
0x8C280D02, // 0041 GETMET R10 R6 K2
0x5830000F, // 0042 LDCONST R12 K15
0x7C280400, // 0043 CALL R10 2
0x782A0009, // 0044 JMPF R10 #004F
0x60280009, // 0045 GETGBL R10 G9
0x942C0D0F, // 0046 GETIDX R11 R6 K15
0x7C280200, // 0047 CALL R10 1
0x5C201400, // 0048 MOVE R8 R10
0x98161E08, // 0049 SETIDX R5 K15 R8
0x542AFFFE, // 004A LDINT R10 65535
0x2428100A, // 004B GT R10 R8 R10
0x782A0000, // 004C JMPF R10 #004E
0x5422FFFE, // 004D LDINT R8 65535
0x501C0200, // 004E LDBOOL R7 1 0
0x8C280D02, // 004F GETMET R10 R6 K2
0x58300010, // 0050 LDCONST R12 K16
0x7C280400, // 0051 CALL R10 2
0x782A000C, // 0052 JMPF R10 #0060
0x60280009, // 0053 GETGBL R10 G9
0x942C0D10, // 0054 GETIDX R11 R6 K16
0x7C280200, // 0055 CALL R10 1
0x5C241400, // 0056 MOVE R9 R10
0x98162009, // 0057 SETIDX R5 K16 R9
0x542A00FD, // 0058 LDINT R10 254
0x2828120A, // 0059 GE R10 R9 R10
0x782A0000, // 005A JMPF R10 #005C
0x542600FE, // 005B LDINT R9 255
0x88280911, // 005C GETMBR R10 R4 K17
0x28281508, // 005D GE R10 R10 K8
0x782A0000, // 005E JMPF R10 #0060
0x501C0200, // 005F LDBOOL R7 1 0
0x781E0003, // 0060 JMPF R7 #0065
0x8C280912, // 0061 GETMET R10 R4 K18
0x5C301000, // 0062 MOVE R12 R8
0x5C341200, // 0063 MOVE R13 R9
0x7C280600, // 0064 CALL R10 3
0x8C280D02, // 0065 GETMET R10 R6 K2
0x58300013, // 0066 LDCONST R12 K19
0x7C280400, // 0067 CALL R10 2
0x782A0006, // 0068 JMPF R10 #0070
0x60280009, // 0069 GETGBL R10 G9
0x942C0D13, // 006A GETIDX R11 R6 K19
0x7C280200, // 006B CALL R10 1
0x9816260A, // 006C SETIDX R5 K19 R10
0x8C2C0914, // 006D GETMET R11 R4 K20
0x5C341400, // 006E MOVE R13 R10
0x7C2C0400, // 006F CALL R11 2
0x8C280D02, // 0070 GETMET R10 R6 K2
0x58300015, // 0071 LDCONST R12 K21
0x7C280400, // 0072 CALL R10 2
0x782A000A, // 0073 JMPF R10 #007F
0x60280009, // 0074 GETGBL R10 G9
0x942C0D15, // 0075 GETIDX R11 R6 K21
0x7C280200, // 0076 CALL R10 1
0x98162A0A, // 0077 SETIDX R5 K21 R10
0x542E00FD, // 0078 LDINT R11 254
0x282C140B, // 0079 GE R11 R10 R11
0x782E0000, // 007A JMPF R11 #007C
0x542A00FE, // 007B LDINT R10 255
0x8C2C0916, // 007C GETMET R11 R4 K22
0x5C341400, // 007D MOVE R13 R10
0x7C2C0400, // 007E CALL R11 2
0x60280012, // 007F GETGBL R10 G18
0x7C280000, // 0080 CALL R10 0
0x602C0010, // 0081 GETGBL R11 G16
0x8C300B17, // 0082 GETMET R12 R5 K23
0x7C300200, // 0083 CALL R12 1
0x7C2C0200, // 0084 CALL R11 1
0xA8020012, // 0085 EXBLK 0 #0099
0x5C301600, // 0086 MOVE R12 R11
0x7C300000, // 0087 CALL R12 0
0x60340008, // 0088 GETGBL R13 G8
0x5C380200, // 0089 MOVE R14 R1
0x7C340200, // 008A CALL R13 1
0x0036300D, // 008B ADD R13 K24 R13
0x00341B19, // 008C ADD R13 R13 K25
0x00341A0C, // 008D ADD R13 R13 R12
0x60380013, // 008E GETGBL R14 G19
0x7C380000, // 008F CALL R14 0
0x603C0013, // 0090 GETGBL R15 G19
0x7C3C0000, // 0091 CALL R15 0
0x94400A0C, // 0092 GETIDX R16 R5 R12
0x983C1A10, // 0093 SETIDX R15 R13 R16
0x983A340F, // 0094 SETIDX R14 K26 R15
0x8C3C151B, // 0095 GETMET R15 R10 K27
0x5C441C00, // 0096 MOVE R17 R14
0x7C3C0400, // 0097 CALL R15 2
0x7001FFEC, // 0098 JMP #0086
0x582C001C, // 0099 LDCONST R11 K28
0xAC2C0200, // 009A CATCH R11 1 0
0xB0080000, // 009B RAISE 2 R0 R0
0x602C000C, // 009C GETGBL R11 G12
0x5C301400, // 009D MOVE R12 R10
0x7C2C0200, // 009E CALL R11 1
0x242C170C, // 009F GT R11 R11 K12
0x782E0001, // 00A0 JMPF R11 #00A3
0x8C2C091D, // 00A1 GETMET R11 R4 K29
0x7C2C0200, // 00A2 CALL R11 1
0x8C2C071E, // 00A3 GETMET R11 R3 K30
0x5C341400, // 00A4 MOVE R13 R10
0x7C2C0400, // 00A5 CALL R11 2
0x80041600, // 00A6 RET 1 R11
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: groups
********************************************************************/
be_local_closure(hue_bridge_monad_groups, /* name */
be_nested_proto(
8, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str(lights),
/* K1 */ be_nested_str(keys),
/* K2 */ be_nested_str(push),
/* K3 */ be_nested_str(_X22),
/* K4 */ be_nested_str(stop_iteration),
/* K5 */ be_const_int(0),
/* K6 */ be_nested_str(concat),
/* K7 */ be_nested_str(_X2C),
}),
&be_const_str_groups,
&be_const_str_solidified,
( &(const binstruction[31]) { /* code */
0x60040012, // 0000 GETGBL R1 G18
0x7C040000, // 0001 CALL R1 0
0x60080010, // 0002 GETGBL R2 G16
0x880C0100, // 0003 GETMBR R3 R0 K0
0x8C0C0701, // 0004 GETMET R3 R3 K1
0x7C0C0200, // 0005 CALL R3 1
0x7C080200, // 0006 CALL R2 1
0xA8020009, // 0007 EXBLK 0 #0012
0x5C0C0400, // 0008 MOVE R3 R2
0x7C0C0000, // 0009 CALL R3 0
0x8C100302, // 000A GETMET R4 R1 K2
0x60180008, // 000B GETGBL R6 G8
0x5C1C0600, // 000C MOVE R7 R3
0x7C180200, // 000D CALL R6 1
0x001A0606, // 000E ADD R6 K3 R6
0x00180D03, // 000F ADD R6 R6 K3
0x7C100400, // 0010 CALL R4 2
0x7001FFF5, // 0011 JMP #0008
0x58080004, // 0012 LDCONST R2 K4
0xAC080200, // 0013 CATCH R2 1 0
0xB0080000, // 0014 RAISE 2 R0 R0
0x6008000C, // 0015 GETGBL R2 G12
0x5C0C0200, // 0016 MOVE R3 R1
0x7C080200, // 0017 CALL R2 1
0x24080505, // 0018 GT R2 R2 K5
0x780A0003, // 0019 JMPF R2 #001E
0x8C080306, // 001A GETMET R2 R1 K6
0x58100007, // 001B LDCONST R4 K7
0x7C080400, // 001C CALL R2 2
0x80040400, // 001D RET 1 R2
0x80000000, // 001E RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: hue_bridge_monad
********************************************************************/
be_local_class(hue_bridge_monad,
1,
NULL,
be_nested_map(10,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(lights, -1), be_const_var(0) },
{ be_const_key(groups, 6), be_const_closure(hue_bridge_monad_groups_closure) },
{ be_const_key(hue_status, -1), be_const_closure(hue_bridge_monad_hue_status_closure) },
{ be_const_key(add_light, -1), be_const_closure(hue_bridge_monad_add_light_closure) },
{ be_const_key(remove_light, 8), be_const_closure(hue_bridge_monad_remove_light_closure) },
{ be_const_key(init, -1), be_const_closure(hue_bridge_monad_init_closure) },
{ be_const_key(cmd, -1), be_const_closure(hue_bridge_monad_cmd_closure) },
{ be_const_key(light_to_id, -1), be_const_closure(hue_bridge_monad_light_to_id_closure) },
{ be_const_key(discover, -1), be_const_closure(hue_bridge_monad_discover_closure) },
{ be_const_key(full_status, 1), be_const_closure(hue_bridge_monad_full_status_closure) },
})),
(bstring*) &be_const_str_hue_bridge_monad
);
/********************************************************************
** Solidified function: _anonymous_
********************************************************************/
be_local_closure(hue_bridge__anonymous_, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_const_class(be_class_hue_bridge_monad),
}),
&be_const_str__anonymous_,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x58040000, // 0000 LDCONST R1 K0
0xB4000000, // 0001 CLASS K0
0x5C080200, // 0002 MOVE R2 R1
0x7C080000, // 0003 CALL R2 0
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified module: hue_bridge
********************************************************************/
be_local_module(hue_bridge,
"hue_bridge",
be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(hue_bridge__anonymous__closure) },
}))
);
BE_EXPORT_VARIABLE be_define_const_native_module(hue_bridge);
/********************************************************************/
/********************************************************************/
/* End of solidification */

View File

@ -0,0 +1,422 @@
/* Solidification of i2c_driver.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
/********************************************************************
** Solidified function: read32
********************************************************************/
be_local_closure(I2C_Driver_read32, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read_bytes),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(0),
/* K4 */ be_const_int(1),
/* K5 */ be_const_int(2),
/* K6 */ be_const_int(3),
}),
&be_const_str_read32,
&be_const_str_solidified,
( &(const binstruction[20]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x541A0003, // 0004 LDINT R6 4
0x7C080800, // 0005 CALL R2 4
0x940C0503, // 0006 GETIDX R3 R2 K3
0x54120017, // 0007 LDINT R4 24
0x380C0604, // 0008 SHL R3 R3 R4
0x94100504, // 0009 GETIDX R4 R2 K4
0x5416000F, // 000A LDINT R5 16
0x38100805, // 000B SHL R4 R4 R5
0x000C0604, // 000C ADD R3 R3 R4
0x94100505, // 000D GETIDX R4 R2 K5
0x54160007, // 000E LDINT R5 8
0x38100805, // 000F SHL R4 R4 R5
0x000C0604, // 0010 ADD R3 R3 R4
0x94100506, // 0011 GETIDX R4 R2 K6
0x000C0604, // 0012 ADD R3 R3 R4
0x80040600, // 0013 RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: write8
********************************************************************/
be_local_closure(I2C_Driver_write8, /* name */
be_nested_proto(
9, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(write),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(1),
}),
&be_const_str_write8,
&be_const_str_solidified,
( &(const binstruction[ 8]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x8C0C0701, // 0001 GETMET R3 R3 K1
0x88140102, // 0002 GETMBR R5 R0 K2
0x5C180200, // 0003 MOVE R6 R1
0x5C1C0400, // 0004 MOVE R7 R2
0x58200003, // 0005 LDCONST R8 K3
0x7C0C0A00, // 0006 CALL R3 5
0x80040600, // 0007 RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read12
********************************************************************/
be_local_closure(I2C_Driver_read12, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read_bytes),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(2),
/* K4 */ be_const_int(0),
/* K5 */ be_const_int(1),
}),
&be_const_str_read12,
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x58180003, // 0004 LDCONST R6 K3
0x7C080800, // 0005 CALL R2 4
0x940C0504, // 0006 GETIDX R3 R2 K4
0x54120003, // 0007 LDINT R4 4
0x380C0604, // 0008 SHL R3 R3 R4
0x94100505, // 0009 GETIDX R4 R2 K5
0x000C0604, // 000A ADD R3 R3 R4
0x80040600, // 000B RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: write_bit
********************************************************************/
be_local_closure(I2C_Driver_write_bit, /* name */
be_nested_proto(
11, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_const_int(0),
/* K1 */ be_const_int(1),
/* K2 */ be_nested_str(write8),
/* K3 */ be_nested_str(read8),
}),
&be_const_str_write_bit,
&be_const_str_solidified,
( &(const binstruction[26]) { /* code */
0x14100500, // 0000 LT R4 R2 K0
0x74120002, // 0001 JMPT R4 #0005
0x54120006, // 0002 LDINT R4 7
0x24100404, // 0003 GT R4 R2 R4
0x78120000, // 0004 JMPF R4 #0006
0x80000800, // 0005 RET 0
0x38120202, // 0006 SHL R4 K1 R2
0x780E0007, // 0007 JMPF R3 #0010
0x8C140102, // 0008 GETMET R5 R0 K2
0x5C1C0200, // 0009 MOVE R7 R1
0x8C200103, // 000A GETMET R8 R0 K3
0x5C280200, // 000B MOVE R10 R1
0x7C200400, // 000C CALL R8 2
0x30201004, // 000D OR R8 R8 R4
0x7C140600, // 000E CALL R5 3
0x70020008, // 000F JMP #0019
0x8C140102, // 0010 GETMET R5 R0 K2
0x5C1C0200, // 0011 MOVE R7 R1
0x8C200103, // 0012 GETMET R8 R0 K3
0x5C280200, // 0013 MOVE R10 R1
0x7C200400, // 0014 CALL R8 2
0x542600FE, // 0015 LDINT R9 255
0x04241204, // 0016 SUB R9 R9 R4
0x2C201009, // 0017 AND R8 R8 R9
0x7C140600, // 0018 CALL R5 3
0x80000000, // 0019 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read24
********************************************************************/
be_local_closure(I2C_Driver_read24, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read_bytes),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(3),
/* K4 */ be_const_int(0),
/* K5 */ be_const_int(1),
/* K6 */ be_const_int(2),
}),
&be_const_str_read24,
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x58180003, // 0004 LDCONST R6 K3
0x7C080800, // 0005 CALL R2 4
0x940C0504, // 0006 GETIDX R3 R2 K4
0x5412000F, // 0007 LDINT R4 16
0x380C0604, // 0008 SHL R3 R3 R4
0x94100505, // 0009 GETIDX R4 R2 K5
0x54160007, // 000A LDINT R5 8
0x38100805, // 000B SHL R4 R4 R5
0x000C0604, // 000C ADD R3 R3 R4
0x94100506, // 000D GETIDX R4 R2 K6
0x000C0604, // 000E ADD R3 R3 R4
0x80040600, // 000F RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read8
********************************************************************/
be_local_closure(I2C_Driver_read8, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(1),
}),
&be_const_str_read8,
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x58180003, // 0004 LDCONST R6 K3
0x7C080800, // 0005 CALL R2 4
0x80040400, // 0006 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(I2C_Driver_init, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str(tasmota),
/* K1 */ be_nested_str(i2c_enabled),
/* K2 */ be_nested_str(addr),
/* K3 */ be_nested_str(wire),
/* K4 */ be_nested_str(wire_scan),
/* K5 */ be_nested_str(function),
/* K6 */ be_nested_str(name),
/* K7 */ be_nested_str(I2C_X3A),
/* K8 */ be_nested_str(detected_X20on_X20bus),
/* K9 */ be_nested_str(bus),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[44]) { /* code */
0x4C100000, // 0000 LDNIL R4
0x20100604, // 0001 NE R4 R3 R4
0x78120005, // 0002 JMPF R4 #0009
0xB8120000, // 0003 GETNGBL R4 K0
0x8C100901, // 0004 GETMET R4 R4 K1
0x5C180600, // 0005 MOVE R6 R3
0x7C100400, // 0006 CALL R4 2
0x74120000, // 0007 JMPT R4 #0009
0x80000800, // 0008 RET 0
0x90020402, // 0009 SETMBR R0 K2 R2
0xB8120000, // 000A GETNGBL R4 K0
0x8C100904, // 000B GETMET R4 R4 K4
0x88180102, // 000C GETMBR R6 R0 K2
0x7C100400, // 000D CALL R4 2
0x90020604, // 000E SETMBR R0 K3 R4
0x88100103, // 000F GETMBR R4 R0 K3
0x78120019, // 0010 JMPF R4 #002B
0x60100004, // 0011 GETGBL R4 G4
0x5C140200, // 0012 MOVE R5 R1
0x7C100200, // 0013 CALL R4 1
0x1C100905, // 0014 EQ R4 R4 K5
0x78120004, // 0015 JMPF R4 #001B
0x5C100200, // 0016 MOVE R4 R1
0x5C140000, // 0017 MOVE R5 R0
0x7C100200, // 0018 CALL R4 1
0x90020C04, // 0019 SETMBR R0 K6 R4
0x70020000, // 001A JMP #001C
0x90020C01, // 001B SETMBR R0 K6 R1
0x88100106, // 001C GETMBR R4 R0 K6
0x4C140000, // 001D LDNIL R5
0x1C100805, // 001E EQ R4 R4 R5
0x78120001, // 001F JMPF R4 #0022
0x4C100000, // 0020 LDNIL R4
0x90020604, // 0021 SETMBR R0 K3 R4
0x88100103, // 0022 GETMBR R4 R0 K3
0x78120006, // 0023 JMPF R4 #002B
0x60100001, // 0024 GETGBL R4 G1
0x58140007, // 0025 LDCONST R5 K7
0x88180106, // 0026 GETMBR R6 R0 K6
0x581C0008, // 0027 LDCONST R7 K8
0x88200103, // 0028 GETMBR R8 R0 K3
0x88201109, // 0029 GETMBR R8 R8 K9
0x7C100800, // 002A CALL R4 4
0x80000000, // 002B RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: read13
********************************************************************/
be_local_closure(I2C_Driver_read13, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str(wire),
/* K1 */ be_nested_str(read_bytes),
/* K2 */ be_nested_str(addr),
/* K3 */ be_const_int(2),
/* K4 */ be_const_int(0),
/* K5 */ be_const_int(1),
}),
&be_const_str_read13,
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x88100102, // 0002 GETMBR R4 R0 K2
0x5C140200, // 0003 MOVE R5 R1
0x58180003, // 0004 LDCONST R6 K3
0x7C080800, // 0005 CALL R2 4
0x940C0504, // 0006 GETIDX R3 R2 K4
0x54120004, // 0007 LDINT R4 5
0x380C0604, // 0008 SHL R3 R3 R4
0x94100505, // 0009 GETIDX R4 R2 K5
0x000C0604, // 000A ADD R3 R3 R4
0x80040600, // 000B RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: I2C_Driver
********************************************************************/
be_local_class(I2C_Driver,
3,
NULL,
be_nested_map(11,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(read32, -1), be_const_closure(I2C_Driver_read32_closure) },
{ be_const_key(write8, 6), be_const_closure(I2C_Driver_write8_closure) },
{ be_const_key(name, -1), be_const_var(2) },
{ be_const_key(addr, 8), be_const_var(1) },
{ be_const_key(read12, -1), be_const_closure(I2C_Driver_read12_closure) },
{ be_const_key(wire, 10), be_const_var(0) },
{ be_const_key(read13, -1), be_const_closure(I2C_Driver_read13_closure) },
{ be_const_key(read24, -1), be_const_closure(I2C_Driver_read24_closure) },
{ be_const_key(read8, -1), be_const_closure(I2C_Driver_read8_closure) },
{ be_const_key(init, -1), be_const_closure(I2C_Driver_init_closure) },
{ be_const_key(write_bit, -1), be_const_closure(I2C_Driver_write_bit_closure) },
})),
(bstring*) &be_const_str_I2C_Driver
);
/*******************************************************************/
void be_load_I2C_Driver_class(bvm *vm) {
be_pushntvclass(vm, &be_class_I2C_Driver);
be_setglobal(vm, "I2C_Driver");
be_pop(vm, 1);
}
/********************************************************************/
/* End of solidification */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,702 @@
/* Solidification of persist.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
/********************************************************************
** Solidified function: json_fdump_map
********************************************************************/
be_local_closure(Persist_json_fdump_map, /* name */
be_nested_proto(
13, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[10]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(write),
/* K2 */ be_nested_str(_X7B),
/* K3 */ be_nested_str(keys),
/* K4 */ be_nested_str(dump),
/* K5 */ be_nested_str(_X3A),
/* K6 */ be_nested_str(json_fdump_any),
/* K7 */ be_nested_str(_X2C),
/* K8 */ be_nested_str(stop_iteration),
/* K9 */ be_nested_str(_X7D),
}),
&be_const_str_json_fdump_map,
&be_const_str_solidified,
( &(const binstruction[41]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x8C100301, // 0001 GETMET R4 R1 K1
0x58180002, // 0002 LDCONST R6 K2
0x7C100400, // 0003 CALL R4 2
0x4C100000, // 0004 LDNIL R4
0x60140010, // 0005 GETGBL R5 G16
0x8C180503, // 0006 GETMET R6 R2 K3
0x7C180200, // 0007 CALL R6 1
0x7C140200, // 0008 CALL R5 1
0xA8020017, // 0009 EXBLK 0 #0022
0x5C180A00, // 000A MOVE R6 R5
0x7C180000, // 000B CALL R6 0
0x4C1C0000, // 000C LDNIL R7
0x201C0807, // 000D NE R7 R4 R7
0x781E0002, // 000E JMPF R7 #0012
0x8C1C0301, // 000F GETMET R7 R1 K1
0x5C240800, // 0010 MOVE R9 R4
0x7C1C0400, // 0011 CALL R7 2
0x8C1C0301, // 0012 GETMET R7 R1 K1
0x8C240704, // 0013 GETMET R9 R3 K4
0x602C0008, // 0014 GETGBL R11 G8
0x5C300C00, // 0015 MOVE R12 R6
0x7C2C0200, // 0016 CALL R11 1
0x7C240400, // 0017 CALL R9 2
0x7C1C0400, // 0018 CALL R7 2
0x8C1C0301, // 0019 GETMET R7 R1 K1
0x58240005, // 001A LDCONST R9 K5
0x7C1C0400, // 001B CALL R7 2
0x8C1C0106, // 001C GETMET R7 R0 K6
0x5C240200, // 001D MOVE R9 R1
0x94280406, // 001E GETIDX R10 R2 R6
0x7C1C0600, // 001F CALL R7 3
0x58100007, // 0020 LDCONST R4 K7
0x7001FFE7, // 0021 JMP #000A
0x58140008, // 0022 LDCONST R5 K8
0xAC140200, // 0023 CATCH R5 1 0
0xB0080000, // 0024 RAISE 2 R0 R0
0x8C140301, // 0025 GETMET R5 R1 K1
0x581C0009, // 0026 LDCONST R7 K9
0x7C140400, // 0027 CALL R5 2
0x80000000, // 0028 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: setmember
********************************************************************/
be_local_closure(Persist_setmember, /* name */
be_nested_proto(
4, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(_dirty),
}),
&be_const_str_setmember,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x980C0202, // 0001 SETIDX R3 R1 R2
0x500C0200, // 0002 LDBOOL R3 1 0
0x90020203, // 0003 SETMBR R0 K1 R3
0x80000000, // 0004 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: zero
********************************************************************/
be_local_closure(Persist_zero, /* name */
be_nested_proto(
2, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(_dirty),
}),
&be_const_str_zero,
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x60040013, // 0000 GETGBL R1 G19
0x7C040000, // 0001 CALL R1 0
0x90020001, // 0002 SETMBR R0 K0 R1
0x50040200, // 0003 LDBOOL R1 1 0
0x90020201, // 0004 SETMBR R0 K1 R1
0x80000000, // 0005 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: member
********************************************************************/
be_local_closure(Persist_member, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(find),
}),
&be_const_str_member,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: json_fdump
********************************************************************/
be_local_closure(Persist_json_fdump, /* name */
be_nested_proto(
7, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(_p),
/* K2 */ be_nested_str(json_fdump_map),
/* K3 */ be_nested_str(internal_error),
/* K4 */ be_nested_str(persist_X2E_p_X20is_X20not_X20a_X20map),
}),
&be_const_str_json_fdump,
&be_const_str_solidified,
( &(const binstruction[13]) { /* code */
0xA40A0000, // 0000 IMPORT R2 K0
0x600C000F, // 0001 GETGBL R3 G15
0x88100101, // 0002 GETMBR R4 R0 K1
0x60140013, // 0003 GETGBL R5 G19
0x7C0C0400, // 0004 CALL R3 2
0x780E0004, // 0005 JMPF R3 #000B
0x8C0C0102, // 0006 GETMET R3 R0 K2
0x5C140200, // 0007 MOVE R5 R1
0x88180101, // 0008 GETMBR R6 R0 K1
0x7C0C0600, // 0009 CALL R3 3
0x70020000, // 000A JMP #000C
0xB0060704, // 000B RAISE 1 K3 K4
0x80000000, // 000C RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: remove
********************************************************************/
be_local_closure(Persist_remove, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(remove),
/* K2 */ be_nested_str(_dirty),
}),
&be_const_str_remove,
&be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x50080200, // 0004 LDBOOL R2 1 0
0x90020402, // 0005 SETMBR R0 K2 R2
0x80000000, // 0006 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: json_fdump_any
********************************************************************/
be_local_closure(Persist_json_fdump_any, /* name */
be_nested_proto(
9, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(json_fdump_map),
/* K2 */ be_nested_str(json_fdump_list),
/* K3 */ be_nested_str(write),
/* K4 */ be_nested_str(dump),
}),
&be_const_str_json_fdump_any,
&be_const_str_solidified,
( &(const binstruction[27]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x6010000F, // 0001 GETGBL R4 G15
0x5C140400, // 0002 MOVE R5 R2
0x60180013, // 0003 GETGBL R6 G19
0x7C100400, // 0004 CALL R4 2
0x78120004, // 0005 JMPF R4 #000B
0x8C100101, // 0006 GETMET R4 R0 K1
0x5C180200, // 0007 MOVE R6 R1
0x5C1C0400, // 0008 MOVE R7 R2
0x7C100600, // 0009 CALL R4 3
0x7002000E, // 000A JMP #001A
0x6010000F, // 000B GETGBL R4 G15
0x5C140400, // 000C MOVE R5 R2
0x60180012, // 000D GETGBL R6 G18
0x7C100400, // 000E CALL R4 2
0x78120004, // 000F JMPF R4 #0015
0x8C100102, // 0010 GETMET R4 R0 K2
0x5C180200, // 0011 MOVE R6 R1
0x5C1C0400, // 0012 MOVE R7 R2
0x7C100600, // 0013 CALL R4 3
0x70020004, // 0014 JMP #001A
0x8C100303, // 0015 GETMET R4 R1 K3
0x8C180704, // 0016 GETMET R6 R3 K4
0x5C200400, // 0017 MOVE R8 R2
0x7C180400, // 0018 CALL R6 2
0x7C100400, // 0019 CALL R4 2
0x80000000, // 001A RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: save
********************************************************************/
be_local_closure(Persist_save, /* name */
be_nested_proto(
7, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 7]) { /* constants */
/* K0 */ be_nested_str(_filename),
/* K1 */ be_nested_str(w),
/* K2 */ be_nested_str(json_fdump),
/* K3 */ be_nested_str(close),
/* K4 */ be_nested_str(write),
/* K5 */ be_nested_str(_X7B_X7D),
/* K6 */ be_nested_str(_dirty),
}),
&be_const_str_save,
&be_const_str_solidified,
( &(const binstruction[37]) { /* code */
0x4C040000, // 0000 LDNIL R1
0xA802000B, // 0001 EXBLK 0 #000E
0x60080011, // 0002 GETGBL R2 G17
0x880C0100, // 0003 GETMBR R3 R0 K0
0x58100001, // 0004 LDCONST R4 K1
0x7C080400, // 0005 CALL R2 2
0x5C040400, // 0006 MOVE R1 R2
0x8C080102, // 0007 GETMET R2 R0 K2
0x5C100200, // 0008 MOVE R4 R1
0x7C080400, // 0009 CALL R2 2
0x8C080303, // 000A GETMET R2 R1 K3
0x7C080200, // 000B CALL R2 1
0xA8040001, // 000C EXBLK 1 1
0x70020013, // 000D JMP #0022
0xAC080002, // 000E CATCH R2 0 2
0x70020010, // 000F JMP #0021
0x4C100000, // 0010 LDNIL R4
0x20100204, // 0011 NE R4 R1 R4
0x78120001, // 0012 JMPF R4 #0015
0x8C100303, // 0013 GETMET R4 R1 K3
0x7C100200, // 0014 CALL R4 1
0x60100011, // 0015 GETGBL R4 G17
0x88140100, // 0016 GETMBR R5 R0 K0
0x58180001, // 0017 LDCONST R6 K1
0x7C100400, // 0018 CALL R4 2
0x5C040800, // 0019 MOVE R1 R4
0x8C100304, // 001A GETMET R4 R1 K4
0x58180005, // 001B LDCONST R6 K5
0x7C100400, // 001C CALL R4 2
0x8C100303, // 001D GETMET R4 R1 K3
0x7C100200, // 001E CALL R4 1
0xB0040403, // 001F RAISE 1 R2 R3
0x70020000, // 0020 JMP #0022
0xB0080000, // 0021 RAISE 2 R0 R0
0x50080000, // 0022 LDBOOL R2 0 0
0x90020C02, // 0023 SETMBR R0 K6 R2
0x80000000, // 0024 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: load
********************************************************************/
be_local_closure(Persist_load, /* name */
be_nested_proto(
9, /* nstack */
1, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[12]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(path),
/* K2 */ be_nested_str(exists),
/* K3 */ be_nested_str(_filename),
/* K4 */ be_nested_str(r),
/* K5 */ be_nested_str(load),
/* K6 */ be_nested_str(read),
/* K7 */ be_nested_str(close),
/* K8 */ be_nested_str(_p),
/* K9 */ be_nested_str(BRY_X3A_X20failed_X20to_X20load_X20_persist_X2Ejson),
/* K10 */ be_nested_str(_dirty),
/* K11 */ be_nested_str(save),
}),
&be_const_str_load,
&be_const_str_solidified,
( &(const binstruction[49]) { /* code */
0xA4060000, // 0000 IMPORT R1 K0
0xA40A0200, // 0001 IMPORT R2 K1
0x4C0C0000, // 0002 LDNIL R3
0x4C100000, // 0003 LDNIL R4
0x8C140502, // 0004 GETMET R5 R2 K2
0x881C0103, // 0005 GETMBR R7 R0 K3
0x7C140400, // 0006 CALL R5 2
0x78160025, // 0007 JMPF R5 #002E
0xA802000D, // 0008 EXBLK 0 #0017
0x60140011, // 0009 GETGBL R5 G17
0x88180103, // 000A GETMBR R6 R0 K3
0x581C0004, // 000B LDCONST R7 K4
0x7C140400, // 000C CALL R5 2
0x5C0C0A00, // 000D MOVE R3 R5
0x8C140305, // 000E GETMET R5 R1 K5
0x8C1C0706, // 000F GETMET R7 R3 K6
0x7C1C0200, // 0010 CALL R7 1
0x7C140400, // 0011 CALL R5 2
0x5C100A00, // 0012 MOVE R4 R5
0x8C140707, // 0013 GETMET R5 R3 K7
0x7C140200, // 0014 CALL R5 1
0xA8040001, // 0015 EXBLK 1 1
0x70020009, // 0016 JMP #0021
0xAC140002, // 0017 CATCH R5 0 2
0x70020006, // 0018 JMP #0020
0x4C1C0000, // 0019 LDNIL R7
0x201C0607, // 001A NE R7 R3 R7
0x781E0001, // 001B JMPF R7 #001E
0x8C1C0707, // 001C GETMET R7 R3 K7
0x7C1C0200, // 001D CALL R7 1
0xB0040A06, // 001E RAISE 1 R5 R6
0x70020000, // 001F JMP #0021
0xB0080000, // 0020 RAISE 2 R0 R0
0x6014000F, // 0021 GETGBL R5 G15
0x5C180800, // 0022 MOVE R6 R4
0x601C0013, // 0023 GETGBL R7 G19
0x7C140400, // 0024 CALL R5 2
0x78160001, // 0025 JMPF R5 #0028
0x90021004, // 0026 SETMBR R0 K8 R4
0x70020002, // 0027 JMP #002B
0x60140001, // 0028 GETGBL R5 G1
0x58180009, // 0029 LDCONST R6 K9
0x7C140200, // 002A CALL R5 1
0x50140000, // 002B LDBOOL R5 0 0
0x90021405, // 002C SETMBR R0 K10 R5
0x70020001, // 002D JMP #0030
0x8C14010B, // 002E GETMET R5 R0 K11
0x7C140200, // 002F CALL R5 1
0x80000000, // 0030 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: find
********************************************************************/
be_local_closure(Persist_find, /* name */
be_nested_proto(
7, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(find),
}),
&be_const_str_find,
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
0x880C0100, // 0000 GETMBR R3 R0 K0
0x8C0C0701, // 0001 GETMET R3 R3 K1
0x5C140200, // 0002 MOVE R5 R1
0x5C180400, // 0003 MOVE R6 R2
0x7C0C0600, // 0004 CALL R3 3
0x80040600, // 0005 RET 1 R3
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(Persist_init, /* name */
be_nested_proto(
6, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 6]) { /* constants */
/* K0 */ be_nested_str(_filename),
/* K1 */ be_nested_str(_persist_X2Ejson),
/* K2 */ be_nested_str(_p),
/* K3 */ be_nested_str(copy),
/* K4 */ be_nested_str(load),
/* K5 */ be_nested_str(_dirty),
}),
&be_const_str_init,
&be_const_str_solidified,
( &(const binstruction[20]) { /* code */
0x90020101, // 0000 SETMBR R0 K0 K1
0x6008000F, // 0001 GETGBL R2 G15
0x5C0C0200, // 0002 MOVE R3 R1
0x60100013, // 0003 GETGBL R4 G19
0x7C080400, // 0004 CALL R2 2
0x780A0003, // 0005 JMPF R2 #000A
0x8C080303, // 0006 GETMET R2 R1 K3
0x7C080200, // 0007 CALL R2 1
0x90020402, // 0008 SETMBR R0 K2 R2
0x70020002, // 0009 JMP #000D
0x60080013, // 000A GETGBL R2 G19
0x7C080000, // 000B CALL R2 0
0x90020402, // 000C SETMBR R0 K2 R2
0x8C080104, // 000D GETMET R2 R0 K4
0x88100102, // 000E GETMBR R4 R0 K2
0x88140100, // 000F GETMBR R5 R0 K0
0x7C080600, // 0010 CALL R2 3
0x50080000, // 0011 LDBOOL R2 0 0
0x90020A02, // 0012 SETMBR R0 K5 R2
0x80000000, // 0013 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: json_fdump_list
********************************************************************/
be_local_closure(Persist_json_fdump_list, /* name */
be_nested_proto(
9, /* nstack */
3, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 8]) { /* constants */
/* K0 */ be_nested_str(json),
/* K1 */ be_nested_str(write),
/* K2 */ be_nested_str(_X5B),
/* K3 */ be_const_int(0),
/* K4 */ be_nested_str(_X2C),
/* K5 */ be_nested_str(json_fdump_any),
/* K6 */ be_const_int(1),
/* K7 */ be_nested_str(_X5D),
}),
&be_const_str_json_fdump_list,
&be_const_str_solidified,
( &(const binstruction[25]) { /* code */
0xA40E0000, // 0000 IMPORT R3 K0
0x8C100301, // 0001 GETMET R4 R1 K1
0x58180002, // 0002 LDCONST R6 K2
0x7C100400, // 0003 CALL R4 2
0x58100003, // 0004 LDCONST R4 K3
0x6014000C, // 0005 GETGBL R5 G12
0x5C180400, // 0006 MOVE R6 R2
0x7C140200, // 0007 CALL R5 1
0x14140805, // 0008 LT R5 R4 R5
0x7816000A, // 0009 JMPF R5 #0015
0x24140903, // 000A GT R5 R4 K3
0x78160002, // 000B JMPF R5 #000F
0x8C140301, // 000C GETMET R5 R1 K1
0x581C0004, // 000D LDCONST R7 K4
0x7C140400, // 000E CALL R5 2
0x8C140105, // 000F GETMET R5 R0 K5
0x5C1C0200, // 0010 MOVE R7 R1
0x94200404, // 0011 GETIDX R8 R2 R4
0x7C140600, // 0012 CALL R5 3
0x00100906, // 0013 ADD R4 R4 K6
0x7001FFEF, // 0014 JMP #0005
0x8C140301, // 0015 GETMET R5 R1 K1
0x581C0007, // 0016 LDCONST R7 K7
0x7C140400, // 0017 CALL R5 2
0x80000000, // 0018 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: has
********************************************************************/
be_local_closure(Persist_has, /* name */
be_nested_proto(
5, /* nstack */
2, /* argc */
2, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 2]) { /* constants */
/* K0 */ be_nested_str(_p),
/* K1 */ be_nested_str(has),
}),
&be_const_str_has,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x88080100, // 0000 GETMBR R2 R0 K0
0x8C080501, // 0001 GETMET R2 R2 K1
0x5C100200, // 0002 MOVE R4 R1
0x7C080400, // 0003 CALL R2 2
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified class: Persist
********************************************************************/
be_local_class(Persist,
3,
NULL,
be_nested_map(16,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(has, 6), be_const_closure(Persist_has_closure) },
{ be_const_key(setmember, -1), be_const_closure(Persist_setmember_closure) },
{ be_const_key(remove, -1), be_const_closure(Persist_remove_closure) },
{ be_const_key(zero, 0), be_const_closure(Persist_zero_closure) },
{ be_const_key(json_fdump, -1), be_const_closure(Persist_json_fdump_closure) },
{ be_const_key(json_fdump_list, 2), be_const_closure(Persist_json_fdump_list_closure) },
{ be_const_key(init, 15), be_const_closure(Persist_init_closure) },
{ be_const_key(find, -1), be_const_closure(Persist_find_closure) },
{ be_const_key(save, -1), be_const_closure(Persist_save_closure) },
{ be_const_key(json_fdump_any, 12), be_const_closure(Persist_json_fdump_any_closure) },
{ be_const_key(_p, 7), be_const_var(1) },
{ be_const_key(_filename, -1), be_const_var(0) },
{ be_const_key(load, -1), be_const_closure(Persist_load_closure) },
{ be_const_key(json_fdump_map, 5), be_const_closure(Persist_json_fdump_map_closure) },
{ be_const_key(_dirty, -1), be_const_var(2) },
{ be_const_key(member, -1), be_const_closure(Persist_member_closure) },
})),
(bstring*) &be_const_str_Persist
);
/********************************************************************
** Solidified function: _anonymous_
********************************************************************/
be_local_closure(persist__anonymous_, /* name */
be_nested_proto(
3, /* nstack */
1, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_const_class(be_class_Persist),
}),
&be_const_str__anonymous_,
&be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */
0x58040000, // 0000 LDCONST R1 K0
0xB4000000, // 0001 CLASS K0
0x5C080200, // 0002 MOVE R2 R1
0x7C080000, // 0003 CALL R2 0
0x80040400, // 0004 RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified module: persist
********************************************************************/
be_local_module(persist,
"persist",
be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(init, -1), be_const_closure(persist__anonymous__closure) },
}))
);
BE_EXPORT_VARIABLE be_define_const_native_module(persist);
/********************************************************************/
/********************************************************************/
/* End of solidification */

View File

@ -0,0 +1,79 @@
/* Solidification of uuid.h */
/********************************************************************\
* Generated code, don't edit *
\********************************************************************/
#include "be_constobj.h"
/********************************************************************
** Solidified function: _anonymous_
********************************************************************/
be_local_closure(uuid__anonymous_, /* name */
be_nested_proto(
12, /* nstack */
0, /* argc */
0, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 5]) { /* constants */
/* K0 */ be_nested_str(string),
/* K1 */ be_nested_str(math),
/* K2 */ be_nested_str(format),
/* K3 */ be_nested_str(_X2508x_X2D_X2504x_X2D_X2504x_X2D_X2504x_X2D_X2504x_X2508x),
/* K4 */ be_nested_str(rand),
}),
&be_const_str__anonymous_,
&be_const_str_solidified,
( &(const binstruction[30]) { /* code */
0xA4020000, // 0000 IMPORT R0 K0
0xA4060200, // 0001 IMPORT R1 K1
0x8C080102, // 0002 GETMET R2 R0 K2
0x58100003, // 0003 LDCONST R4 K3
0x8C140304, // 0004 GETMET R5 R1 K4
0x7C140200, // 0005 CALL R5 1
0x8C180304, // 0006 GETMET R6 R1 K4
0x7C180200, // 0007 CALL R6 1
0x541EFFFE, // 0008 LDINT R7 65535
0x2C180C07, // 0009 AND R6 R6 R7
0x8C1C0304, // 000A GETMET R7 R1 K4
0x7C1C0200, // 000B CALL R7 1
0x54220FFE, // 000C LDINT R8 4095
0x2C1C0E08, // 000D AND R7 R7 R8
0x54223FFF, // 000E LDINT R8 16384
0x301C0E08, // 000F OR R7 R7 R8
0x8C200304, // 0010 GETMET R8 R1 K4
0x7C200200, // 0011 CALL R8 1
0x54263FFE, // 0012 LDINT R9 16383
0x2C201009, // 0013 AND R8 R8 R9
0x54267FFF, // 0014 LDINT R9 32768
0x30201009, // 0015 OR R8 R8 R9
0x8C240304, // 0016 GETMET R9 R1 K4
0x7C240200, // 0017 CALL R9 1
0x542AFFFE, // 0018 LDINT R10 65535
0x2C24120A, // 0019 AND R9 R9 R10
0x8C280304, // 001A GETMET R10 R1 K4
0x7C280200, // 001B CALL R10 1
0x7C081000, // 001C CALL R2 8
0x80040400, // 001D RET 1 R2
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified module: uuid
********************************************************************/
be_local_module(uuid,
"uuid",
be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key(uuid4, -1), be_const_closure(uuid__anonymous__closure) },
}))
);
BE_EXPORT_VARIABLE be_define_const_native_module(uuid);
/********************************************************************/
/********************************************************************/
/* End of solidification */