import { Context } from "https://deno.land/x/macromania_assets@v0.2.0/deps.ts";
The state that is threaded through an evaluation process.
Constructors
new
Context(loggingBackend?: LoggingTarget)Create a new Context
, logging to the given LoggingTarget
.
Properties
Methods
private
doEvaluate(exp: Expression): Promise<Expression>private
doLogBlockingExpressions(exp: Expression, info: DebuggingInformation)private
logBlockingExpressions(exp: Expression)private
printNonExp(x: any): ExpressionReturn whether evaluation has been given up because no progress could be made.
evaluate(expression: Expression): Promise<string | null>
Evaluate an expression to a string, or return null
in case of failure.
getRound(): number
halt(): Expression
Print a stacktrace, then immediately and faultily terminate evaluation.
log(...data: any[]): void
Log a message.
mustMakeProgress(): boolean
When no impure expression makes progress in an evaluation
round, another round is started, in which this function returns true
.
If no impure expression makes progress in that round either,
evaluation stops.
Print a stacktrace to the console.