GuestLanguageEvaluator

A GuestLanguage feature for evaluating Source code in a given PolyglotContext.

Install an implementation of this interface using a PolyglotContextElement with a key obtained from GuestLanguageEvaluator.contextElementFor, with the target language as identifier, to intercept calls to PolyglotContext.evaluate.

PolyglotContext implementations will always prefer delegating execution to a GuestLanguageEvaluator for the relevant source if one is registered, falling back to their defaults if none is found.

See also

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun accepts(source: Source): Boolean

Analyzes the given source and returns whether it can be used with this evaluator.

Link copied to clipboard
abstract fun evaluate(source: Source, context: PolyglotContext): PolyglotValue

Evaluate a source in the given context, returning the result.