Function run

Source
pub fn run() -> !
Expand description

Compiles and runs a JSON-based program using the Jsonpiler. This function performs the following steps:

  1. Parses the first CLI argument as the input JSON file path.
  2. Reads the file content into a string.
  3. Parses it into a Json structure.
  4. Compiles it into assembly.
  5. Assembles to .obj.
  6. Links to .exe.
  7. Executes the .exe.
  8. Exits with its exit code.

§Panics

Panics if:

  • Not on Windows
  • Incorrect CLI arguments
  • File read, parse, compile, assemble, link, execute, or wait fails
  • Invalid filename or working directory

§Notes

Requires as and ld in PATH. Terminates with error_exit on failure (exit code 1).

§Example

./jsonpiler test.json

§Platform

Windows only.