pub struct Jsonpiler { /* private fields */ }
Expand description
Parser and compiler.
Implementations§
Source§impl Jsonpiler
impl Jsonpiler
Sourcepub fn build(
&mut self,
source: String,
json_file: &str,
filename: &str,
) -> Result<(), Box<dyn Error>>
pub fn build( &mut self, source: String, json_file: &str, filename: &str, ) -> Result<(), Box<dyn Error>>
Builds the assembly code from the parsed JSON. This function is the main entry point for the compilation process. It takes the parsed JSON, sets up the initial function table, evaluates the JSON, and writes the resulting assembly code to a file.
§Arguments
source
- The JSON String.json_file
- The name of the original JSON file.filename
- The name of the file to write the assembly code to.
§Returns
Ok(Json)
- The result of the evaluation.Err(Box<dyn Error>)
- If an error occurred during the compilation process.
§Errors
Box<dyn Error>
- If an error occurred during the compilation process.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Jsonpiler
impl RefUnwindSafe for Jsonpiler
impl Send for Jsonpiler
impl Sync for Jsonpiler
impl Unpin for Jsonpiler
impl UnwindSafe for Jsonpiler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more