Make Pair a record

This commit is contained in:
dfsek
2026-01-01 20:09:52 -07:00
parent eb6b3704d0
commit 47bdd66fe7
11 changed files with 24 additions and 49 deletions

View File

@@ -121,11 +121,11 @@ public class Scope {
}
public int getIndex(String id) {
return indices.get(id).getLeft();
return indices.get(id).left();
}
public ReturnType getType(String id) {
return indices.get(id).getRight();
return indices.get(id).right();
}

View File

@@ -41,8 +41,8 @@ public class IfKeyword implements Keyword<Block.ReturnInfo<?>> {
if(statement.apply(implementationArguments, scope)) return conditional.apply(implementationArguments, scope);
else {
for(Pair<Returnable<Boolean>, Block> pair : elseIf) {
if(pair.getLeft().apply(implementationArguments, scope)) {
return pair.getRight().apply(implementationArguments, scope);
if(pair.left().apply(implementationArguments, scope)) {
return pair.right().apply(implementationArguments, scope);
}
}
if(elseBlock != null) return elseBlock.apply(implementationArguments, scope);