From f303731ca75c91af2584690fb9f1cd3e2c6217c8 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 2 Feb 2025 19:30:12 +0000 Subject: Clarify relational int instructions --- .../shedlang/compiler/shid/instructions/ShidIntGreaterThan.java | 6 +++--- .../compiler/shid/instructions/ShidIntGreaterThanOrEqual.java | 7 ++++--- .../org/shedlang/compiler/shid/instructions/ShidIntLessThan.java | 6 +++--- .../compiler/shid/instructions/ShidIntLessThanOrEqual.java | 7 ++++--- 4 files changed, 14 insertions(+), 12 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntGreaterThan.java b/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntGreaterThan.java index 9d33319f..9a86688c 100644 --- a/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntGreaterThan.java +++ b/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntGreaterThan.java @@ -3,9 +3,9 @@ package org.shedlang.compiler.shid.instructions; import org.shedlang.compiler.sources.Source; /** - * Pop two values from the temporary value stack, compare them as Ints, and push - * a Bool onto the temporary value stack: true if the first is greater than the - * second, false otherwise. + * Pop the right operand from the temporary value stack, then the left operand + * from the temporary value stack, calculate whether the left operand is greater + * than the right operand, then push the result onto the temporary value stack. */ public record ShidIntGreaterThan(Source source) implements ShidInstruction { @Override diff --git a/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntGreaterThanOrEqual.java b/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntGreaterThanOrEqual.java index d0517181..ed27be97 100644 --- a/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntGreaterThanOrEqual.java +++ b/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntGreaterThanOrEqual.java @@ -3,9 +3,10 @@ package org.shedlang.compiler.shid.instructions; import org.shedlang.compiler.sources.Source; /** - * Pop two values from the temporary value stack, compare them as Ints, and push - * a Bool onto the temporary value stack: true if the first is greater than or - * equal to the second, false otherwise. + * Pop the right operand from the temporary value stack, then the left operand + * from the temporary value stack, calculate whether the left operand is greater + * than or equal to the right operand, then push the result onto the temporary + * value stack. */ public record ShidIntGreaterThanOrEqual(Source source) implements ShidInstruction { @Override diff --git a/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntLessThan.java b/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntLessThan.java index b16e032a..60dc9b75 100644 --- a/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntLessThan.java +++ b/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntLessThan.java @@ -3,9 +3,9 @@ package org.shedlang.compiler.shid.instructions; import org.shedlang.compiler.sources.Source; /** - * Pop two values from the temporary value stack, compare them as Ints, and push - * a Bool onto the temporary value stack: true if the first is less than the - * second, false otherwise. + * Pop the right operand from the temporary value stack, then the left operand + * from the temporary value stack, calculate whether the left operand is less + * than the right operand, then push the result onto the temporary value stack. */ public record ShidIntLessThan(Source source) implements ShidInstruction { @Override diff --git a/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntLessThanOrEqual.java b/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntLessThanOrEqual.java index 1d8a16a3..b96ca155 100644 --- a/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntLessThanOrEqual.java +++ b/src/main/java/org/shedlang/compiler/shid/instructions/ShidIntLessThanOrEqual.java @@ -3,9 +3,10 @@ package org.shedlang.compiler.shid.instructions; import org.shedlang.compiler.sources.Source; /** - * Pop two values from the temporary value stack, compare them as Ints, and push - * a Bool onto the temporary value stack: true if the first is less than or - * equal to the second, false otherwise. + * Pop the right operand from the temporary value stack, then the left operand + * from the temporary value stack, calculate whether the left operand is less + * than or equal to the right operand, then push the result onto the temporary + * value stack. */ public record ShidIntLessThanOrEqual(Source source) implements ShidInstruction { @Override -- cgit v1.2.3