Skip to content

Commit 4dd8428

Browse files
committed
misc: more refactorings
1 parent 01ce520 commit 4dd8428

File tree

4 files changed

+2
-6
lines changed

4 files changed

+2
-6
lines changed

Diff for: base/src/main/java/org/aya/tyck/unify/TermComparator.java

-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ private boolean visitLists(SeqView<Term> l, SeqView<Term> r, Sub lr, Sub rl, @No
256256
else return null;
257257
}
258258

259-
@SuppressWarnings("unused")
260259
private boolean doCompareTyped(@NotNull Term type, @NotNull Term lhs, @NotNull Term rhs, Sub lr, Sub rl) {
261260
// Skip tracing, because too easy.
262261
// Note that it looks tempting to apply some unification here, but it is not correct:

Diff for: cli-impl/src/main/java/org/aya/cli/literate/SyntaxHighlight.java

-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ else if (SPECIAL_SYMBOL.contains(tokenType))
152152
return kindOf(var).toRef(sourcePos, BasePrettier.linkIdOf(currentFileModule, var), type);
153153
}
154154

155-
@SuppressWarnings("unused")
156155
public static @NotNull DefKind kindOf(@NotNull AnyVar var) {
157156
return switch (var) {
158157
case GeneralizedVar _ -> DefKind.Generalized;

Diff for: tools-kala/src/main/java/org/aya/util/terck/Relation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ record Decrease(boolean usable, int size) implements Relation {
3434
@Override default @NotNull Doc toDoc() {
3535
return switch (this) {
3636
case Decrease d when d.size == 0 -> Doc.plain(" =");
37-
case Decrease d -> Doc.plain((d.usable ? " " : "!") + "-" + d.size);
37+
case Decrease d -> Doc.plain(STR."\{d.usable ? " " : "!"}-\{d.size}");
3838
case Unknown ignored -> Doc.plain(" ?");
3939
};
4040
}

Diff for: tools/src/main/java/org/aya/util/error/SourcePos.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* @param tokenStartIndex The index of first character (inclusive)
1818
* @author kiva
1919
*/
20-
@SuppressWarnings("unused")
2120
public record SourcePos(
2221
@NotNull SourceFile file,
2322
int tokenStartIndex,
@@ -136,8 +135,7 @@ public int linesOfCode() {
136135
}
137136

138137
@Override public String toString() {
139-
return "(" + tokenStartIndex + "-" + tokenEndIndex + ") ["
140-
+ startLine + "," + startColumn + "-" + endLine + "," + endColumn + ']';
138+
return STR."(\{tokenStartIndex}-\{tokenEndIndex}) [\{startLine},\{startColumn}-\{endLine},\{endColumn}\{']'}";
141139
}
142140

143141
@Override

0 commit comments

Comments
 (0)