Add comments to Evaluator

This commit is contained in:
Christopher Schleiden
2023-01-19 09:58:50 -08:00
parent f840cd2599
commit 7d9132fb6e
+6
View File
@@ -20,6 +20,12 @@ import {TokenType} from "./lexer";
import {equals, falsy, greaterThan, lessThan, truthy} from "./result";
export class Evaluator implements ExprVisitor<data.ExpressionData> {
/**
* Creates a new evaluator
* @param n Parsed expression to evaluate
* @param context Context data to use
* @param functions Optional map of function implementations. If given, these will be preferred over the built-in functions.
*/
constructor(private n: Expr, private context: data.Dictionary, private functions?: Map<string, FunctionDefinition>) {}
public evaluate(): data.ExpressionData {