This repository has been archived by the owner on May 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f06e263
commit ebeba8e
Showing
8 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
...va/org/aya/syntax/core/term/DataCall.java → ...g/aya/syntax/core/term/call/DataCall.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
base/src/main/java/org/aya/syntax/core/term/call/FnCall.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2020-2023 Tesla (Yinsen) Zhang. | ||
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file. | ||
package org.aya.syntax.core.term.call; | ||
|
||
import kala.collection.immutable.ImmutableSeq; | ||
import kala.function.IndexedFunction; | ||
import org.aya.syntax.concrete.stmt.decl.TeleDecl; | ||
import org.aya.syntax.core.def.FnDef; | ||
import org.aya.syntax.core.term.Term; | ||
import org.aya.syntax.ref.DefVar; | ||
import org.aya.util.Arg; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public record FnCall( | ||
@Override @NotNull DefVar<FnDef, TeleDecl.FnDecl> ref, | ||
@Override int ulift, | ||
@Override @NotNull ImmutableSeq<Arg<@NotNull Term>> args | ||
) implements Callable.Tele { | ||
public @NotNull FnCall update(@NotNull ImmutableSeq<Arg<Term>> args) { | ||
return args.sameElements(args(), true) ? this : new FnCall(ref, ulift, args); | ||
} | ||
|
||
@Override | ||
public @NotNull Term descent(@NotNull IndexedFunction<Term, Term> f) { | ||
return update(args.map(x -> x.descent(t -> f.apply(0, t)))); | ||
} | ||
} |