From 897c2657e2e9e8d39334769388b62a2770a91208 Mon Sep 17 00:00:00 2001 From: "Jurgen J. Vinju" Date: Tue, 4 Jun 2024 19:33:41 +0200 Subject: [PATCH] fixed more errors --- CITATION => CITATION.md | 0 FUNDING => FUNDING.md | 0 src/lang/flybytes/api/JavaLang.rsc | 4 ++-- src/lang/flybytes/demo/pico/Compiler.rsc | 5 +---- src/lang/flybytes/tests/ComparisonTests.rsc | 2 +- src/lang/flybytes/tests/MirrorTests.rsc | 2 +- 6 files changed, 5 insertions(+), 8 deletions(-) rename CITATION => CITATION.md (100%) rename FUNDING => FUNDING.md (100%) diff --git a/CITATION b/CITATION.md similarity index 100% rename from CITATION rename to CITATION.md diff --git a/FUNDING b/FUNDING.md similarity index 100% rename from FUNDING rename to FUNDING.md diff --git a/src/lang/flybytes/api/JavaLang.rsc b/src/lang/flybytes/api/JavaLang.rsc index b7484ab..41764c5 100644 --- a/src/lang/flybytes/api/JavaLang.rsc +++ b/src/lang/flybytes/api/JavaLang.rsc @@ -38,8 +38,8 @@ int maxIntValue(long()) = LongMirror().getStatic("MAX_VALUE").toValue(#int) int maxIntValue(byte()) = ByteMirror().getStatic("MAX_VALUE").toValue(#int); @synopsis{the minimal value for an arithmetic type on the JVM} -real minRealValue(float()) = -1 * maxValue(float()); -real minRealValue(double()) = -1 * maxValue(double()); +real minRealValue(float()) = -1 * maxRealValue(float()); +real minRealValue(double()) = -1 * maxRealValue(double()); int minIntValue(byte()) = ByteMirror().getStatic("MIN_VALUE").toValue(#int); int minIntValue(long()) = LongMirror().getStatic("MIN_VALUE").toValue(#int); int minIntValue(integer()) = IntegerMirror().getStatic("MIN_VALUE").toValue(#int); diff --git a/src/lang/flybytes/demo/pico/Compiler.rsc b/src/lang/flybytes/demo/pico/Compiler.rsc index 3b7d83e..06d7f99 100644 --- a/src/lang/flybytes/demo/pico/Compiler.rsc +++ b/src/lang/flybytes/demo/pico/Compiler.rsc @@ -68,10 +68,7 @@ Stat stat(s:(Statement) 'else ' <{Statement ";"}* elsePart> 'fi`) - = \if(ne(expr(cond), iconst(0)), stats(thenPart), stats(elsePart)) when /Id x := thenPart - - - + = \if(ne(expr(cond), iconst(0)), stats(thenPart), stats(elsePart)) when /Id x := thenPart; Stat stat(s:(Statement) `while do diff --git a/src/lang/flybytes/tests/ComparisonTests.rsc b/src/lang/flybytes/tests/ComparisonTests.rsc index 8482c72..61dee6c 100644 --- a/src/lang/flybytes/tests/ComparisonTests.rsc +++ b/src/lang/flybytes/tests/ComparisonTests.rsc @@ -47,7 +47,7 @@ test bool testNEqTrue(int i) test bool testNEqFalse(int i) = all (t <- intTypes, - I := prim(t, abs(i) % maxValue(t)), + I := prim(t, abs(i) % maxIntValue(t)), testCmpOp(cmpOpClass(t, ne), t, I, I, false)); test bool testLt(int i, int j) diff --git a/src/lang/flybytes/tests/MirrorTests.rsc b/src/lang/flybytes/tests/MirrorTests.rsc index 5411433..5d66d86 100644 --- a/src/lang/flybytes/tests/MirrorTests.rsc +++ b/src/lang/flybytes/tests/MirrorTests.rsc @@ -85,7 +85,7 @@ test bool arrayLoadInteger() = array(integer(), [integer(1331)]).load(0).toValue(#int) == 1331; test bool arrayLoadLong() - = array(long(), [long(maxValue(long()))]).load(0).toValue(#int) == maxValue(long()); + = array(long(), [long(maxIntValue(long()))]).load(0).toValue(#int) == maxIntValue(long()); test bool arrayLoadObjectNull() = array(object(), 10).load(0) == Mirror::null();