Matchbox 0.2

Command Line

Matchbox 0.2 supports the following forms:

Command Purpose
matchbox Start the interactive prompt.
matchbox file.mb Compile and run a source file.
matchbox -d file.mb Compile and display bytecode without running it.
matchbox --version Display the installed version.

Interactive Prompt

Run matchbox without arguments to start the prompt:

matchbox

Enter Matchbox statements after >>>. Send end-of-file to leave the prompt (on Windows, press Ctrl+Z, then Enter).

Compile and Run

matchbox main.mb

The source file is compiled in memory and runs only if compilation succeeds. 0.2 does not create a standalone executable.

Disassemble

matchbox -d main.mb

This displays the generated bytecode and does not run the program. Bytecode is an implementation detail and may change between releases.

Version

matchbox --version

The output displays the installed Matchbox version. For this documentation, use a Matchbox 0.2 patch release.

Errors and Exit Status

Unknown options, unreadable files, syntax errors, invalid function arguments, undefined names, uninitialized reads, and stack overflow report an error and exit with status 1. Successful commands and the built-in exit function use status 0.

Only Matchbox's own options and source filename are accepted. Running programs cannot receive command-line arguments in 0.2.