All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aya.concrete.resolve.context.NoExportContext Maven / Gradle / Ivy

There is a newer version: 0.33.0
Show newest version
// Copyright (c) 2020-2021 Yinsen (Tesla) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
package org.aya.concrete.resolve.context;

import kala.collection.Seq;
import kala.collection.immutable.ImmutableSeq;
import kala.collection.mutable.MutableHashMap;
import kala.collection.mutable.MutableMap;
import org.aya.api.ref.Var;
import org.jetbrains.annotations.NotNull;

import java.nio.file.Path;

/**
 * @author ice1000
 * Used for examples and counterexamples
 */
public record NoExportContext(
  @NotNull PhysicalModuleContext parent,
  @NotNull MutableMap, Var>> definitions,
  @NotNull MutableMap, MutableMap> modules
) implements ModuleContext {
  @Override
  public @NotNull ImmutableSeq moduleName() {
    return parent.moduleName().appended(":NoExport");
  }

  public NoExportContext(@NotNull PhysicalModuleContext parent) {
    this(parent, MutableMap.create(),
      MutableHashMap.of(TOP_LEVEL_MOD_NAME, MutableHashMap.create()));
  }

  @Override public @NotNull Path underlyingFile() {
    return parent.underlyingFile();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy