Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
misc: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
HoshinoTented committed Jan 16, 2024
1 parent ebeba8e commit ff50b0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.aya.util.reporter.Reporter;
import org.jetbrains.annotations.NotNull;

public sealed abstract class AbstractExprTycker implements StatedTycker, ContextTycker, Problematic permits ExprTycker {
public sealed abstract class AbstractExprTycker implements StateBased, ContextBased, Problematic permits ExprTycker {
public @NotNull TyckState state;
private @NotNull LocalCtx localCtx;
public final @NotNull Reporter reporter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
package org.aya.tyck.tycker;

import org.aya.syntax.ref.LocalCtx;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;

import java.util.function.Supplier;

public sealed interface ContextTycker permits AbstractExprTycker {
public sealed interface ContextBased permits AbstractExprTycker {
@NotNull LocalCtx localCtx();

/**
Expand All @@ -16,8 +17,10 @@ public sealed interface ContextTycker permits AbstractExprTycker {
* @param ctx new {@link LocalCtx}
* @return old context
*/
@Contract(mutates = "this")
@NotNull LocalCtx setLocalCtx(@NotNull LocalCtx ctx);

@Contract(mutates = "this")
default <R> R subscoped(@NotNull Supplier<R> action) {
var parentCtx = setLocalCtx(localCtx().derive());
var result = action.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import org.aya.syntax.core.def.FnDef;
import org.aya.syntax.core.def.TeleDef;
import org.aya.syntax.core.term.*;
import org.aya.syntax.core.term.call.Callable;
import org.aya.syntax.ref.DefVar;
import org.aya.tyck.Result;
import org.aya.tyck.TyckState;
import org.aya.util.Arg;
import org.aya.util.reporter.Reporter;
import org.jetbrains.annotations.NotNull;

/**
Expand All @@ -25,7 +25,7 @@
* @see #defCall
* @see #conOwnerSubst(ConCall)
*/
public sealed interface StatedTycker permits AbstractExprTycker {
public sealed interface StateBased permits AbstractExprTycker {
@NotNull TyckState state();

@NotNull Term whnf(@NotNull Term term);
Expand Down

0 comments on commit ff50b0c

Please sign in to comment.