File tree 3 files changed +33
-0
lines changed
3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -80,11 +80,17 @@ pub struct ModuleDeclaration {
80
80
pub ( crate ) off : usize , // offset within the parent module
81
81
}
82
82
83
+ #[ derive( Clone , Debug ) ]
84
+ pub struct ArrayDefinition {
85
+ pub ( crate ) dimensions : Vec < usize > ,
86
+ }
87
+
83
88
// these are things that will be shared across bytecode runlists
84
89
#[ derive( Clone , Debug ) ]
85
90
pub struct ByteCodeContext {
86
91
pub ( crate ) graphical_functions : Vec < Vec < ( f64 , f64 ) > > ,
87
92
pub ( crate ) modules : Vec < ModuleDeclaration > ,
93
+ pub ( crate ) arrays : Vec < ArrayDefinition > ,
88
94
}
89
95
90
96
#[ derive( Clone , Debug , Default ) ]
Original file line number Diff line number Diff line change @@ -1745,6 +1745,7 @@ impl<'module> Compiler<'module> {
1745
1745
context : Rc :: new ( ByteCodeContext {
1746
1746
graphical_functions : self . graphical_functions ,
1747
1747
modules : self . module_decls ,
1748
+ arrays : vec ! [ ] ,
1748
1749
} ) ,
1749
1750
compiled_initials,
1750
1751
compiled_flows,
Original file line number Diff line number Diff line change @@ -299,3 +299,29 @@ message Project {
299
299
repeated Model models = 3 ;
300
300
Source source = 5 ;
301
301
};
302
+
303
+ // the following are for serializing and deserializing the bytecode/data sent to the engine for a model
304
+
305
+ enum BuiltinId {
306
+ UNSPECIFIED = 0 ;
307
+ Abs = 1 ;
308
+ Arccos = 2 ;
309
+ Arcsin = 3 ;
310
+ Arctan = 4 ;
311
+ Cos = 5 ;
312
+ Exp = 6 ;
313
+ Inf = 7 ;
314
+ Int = 8 ;
315
+ Ln = 9 ;
316
+ Log10 = 10 ;
317
+ Max = 11 ;
318
+ Min = 12 ;
319
+ Pi = 13 ;
320
+ Pulse = 14 ;
321
+ Ramp = 15 ;
322
+ SafeDiv = 16 ;
323
+ Sin = 17 ;
324
+ Sqrt = 18 ;
325
+ Step = 19 ;
326
+ Tan = 20 ;
327
+ };
You can’t perform that action at this time.
0 commit comments