debug.mtr
The debug
module provides functions for debugging purposes.
explain
The explain
function is useful for finding out why a certain value is what it is. It will print out all steps that were taken to get to the value. The way this works is by printing a tree-like structure with each step being either the entrypoint with the input or exit of a node with its result. This also allows you to see how the parser parsed your input amd the internal representation of your code.
The function with no arguments as first parameter will be called and evaluated. The result of that function will be returned.
The function can optionally take up to three more boolean arguments, changing what details are printed. All of these flags are located inside the MenterDebugger
class.
The first argument sets the value of
logInterpreterEvaluationStyle
to either0
or2
,the second one sets
logInterpreterResolveSymbols
to eithertrue
orfalse
and the third one sets
logInterpreterAssignments
to eithertrue
orfalse
breakFlow
The breakFlow
function is used to break the execution flow of the program. Seeing as there is no visual debugger, this happens on the command line. Calling this function will activate debugger mode.
Do not call this method in the code boxes on this page, as this will halt the execution of all code boxes without the option to reactivate them via the code boxes below.