From 3ae0351ea110eb8bd6a4831ae1c3dd125852afdf Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Mon, 31 Jan 2022 03:16:01 -0500 Subject: Add .gitattributes to try to highlight code as Rust --- .gitattributes | 1 + std/math.cup | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e785f75 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.cup linguist-language=Rust \ No newline at end of file diff --git a/std/math.cup b/std/math.cup index 9ac935c..d58aa86 100644 --- a/std/math.cup +++ b/std/math.cup @@ -7,7 +7,7 @@ fn max(a: int, b: int): int { } fn sign(a: int): int { - return a > 0 ? 1 : a < 0 ? -1 : 0; + return a > 0 ? 1 : a == 0 ? 0 : -1; } fn abs(a: int): int { -- cgit v1.2.3