printStackTrace (--)
Inputs
- None.
Outputs
- None.
printStackTrace does not change the data stack. It only prints the current scope stack.
Behavior
- The first printed frame is the current location.
- Older frames follow on later lines with the suffix
, Called from here. - Each line includes the file path, line, column, and the formatted source text of the node for that frame.
Example
test.mpl
{} 0 {} [
inner: [printStackTrace];
outer: [inner];
outer
0
] "main" exportFunction
Expected Output During Compilation
test.mpl(2,11): «printStackTrace»
test.mpl(3,11): «inner», Called from here
test.mpl(4,3): «outer», Called from here
test.mpl(6,10): «exportFunction», Called from here
See also
failCompilationbuiltin(--)Aborts compilation immediately.getCallTracebuiltin(-- callTrace)Returns a Ref to the current call trace, orNILwhen unavailable.printCompilerMessagebuiltin(message --)Prints a known Text message during compilation and appends one line-feed character.printStackbuiltin(--)Prints the current data stack in canonical formatter form; it does not itself pop stack objects.raiseStaticErrorbuiltin(message --)Raises a compile-time error with the given known Text message.