use of org.jetbrains.kotlin.codegen.context.ScriptContext in project kotlin by JetBrains.
the class ScriptCodegen method createScriptCodegen.
public static ScriptCodegen createScriptCodegen(@NotNull KtScript declaration, @NotNull GenerationState state, @NotNull CodegenContext parentContext) {
BindingContext bindingContext = state.getBindingContext();
ScriptDescriptor scriptDescriptor = bindingContext.get(BindingContext.SCRIPT, declaration);
assert scriptDescriptor != null;
Type classType = state.getTypeMapper().mapType(scriptDescriptor);
ClassBuilder builder = state.getFactory().newVisitor(JvmDeclarationOriginKt.OtherOrigin(declaration, scriptDescriptor), classType, declaration.getContainingFile());
List<ScriptDescriptor> earlierScripts = state.getReplSpecific().getEarlierScriptsForReplInterpreter();
ScriptContext scriptContext = parentContext.intoScript(scriptDescriptor, earlierScripts == null ? Collections.<ScriptDescriptor>emptyList() : earlierScripts, scriptDescriptor, state.getTypeMapper());
return new ScriptCodegen(declaration, state, scriptContext, builder);
}
Aggregations