2.2. Debug Support

TODO.

2.2.1. Instructions

debug.assert op1 op2 [debug::Assert]
Operator 1:bool
Operator 2:[ string ]

If compiled in debug mode, verifies that op1 is true. If not, throws an ~~AssertionError exception with op2 as its value if given. A no-op in release mode.

debug.internal_error op1 [debug::InternalError]
Operator 1:string

Throws an InternalError exception, setting op1 as the its argument. Note: This is just a convenience instruction; one can also raise the exception directly.

debug.msg op1 op2 op3 [debug::Msg]
Operator 1:string
Operator 2:string
Operator 3:tuple<*>

If compiled in debug mode, prints a debug message to stderr. The message is only printed of the debug stream op1 has been activated. op2 is printf-style format string and op3 the correponding arguments.

debug.pop_indent [debug::PopIndent]

Decreases the indentation in debugging output by one level. Note: The indentation level is global across all debug streams, but separately tracked for each thread.

debug.push_indent [debug::PushIndent]

Increases the indentation in debugging output by one level. Note: The indentation level is global across all debug streams, but separately tracked for each thread.