Skip to content

Commit

Permalink
fixed more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Jun 4, 2024
1 parent 1dc3e9a commit 897c265
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/lang/flybytes/api/JavaLang.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/lang/flybytes/demo/pico/Compiler.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Expression cond> do
Expand Down
2 changes: 1 addition & 1 deletion src/lang/flybytes/tests/ComparisonTests.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/lang/flybytes/tests/MirrorTests.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 897c265

Please sign in to comment.