pub fn run() -> ExitCode
Expand description
Compiles and executes a JSON-based program using the Jsonpiler. This function performs the following steps:
- Parses the first CLI argument as the input JSON file path.
- Reads the file content into a string.
- Parses the string into a
Json
structure. - Compiles the structure into assembly code.
- Assembles it into an
.obj
file. - Links it into an
.exe
. - Executes the resulting binary.
- Returns its exit code.
§Panics
This function will panic if:
- The platform is not Windows.
- CLI arguments are invalid.
- File reading, parsing, compilation, assembling, linking, or execution fails.
- The working directory or executable filename is invalid.
§Requirements
as
andld
must be available in the system PATH.- On failure, exits with code 1 using
error_exit
.
§Example
./jsonpiler test.json
§Platform
Windows only.