Skip to content

3.5.4

Choose a tag to compare

@Helltar Helltar released this 04 Oct 13:15
· 2 commits to master since this release
3.5.4
83d4de6

The case statement compiles, and a unit's negative integer constants keep their sign in the modules that use it.

  • case … of. The parser used to recognise it only to reject it with E442. It now compiles for integer, char and string selectors. A label is a literal or a named constant, a unit's included, and can be negative, one of a comma-separated list, or a low..high range; an arm may be empty, and an optional else part takes any number of statements up to end. The first matching arm runs and nothing falls through. A label that repeats or overlaps an earlier one is the new error E465 duplicate case label; E442 is gone.
  • Inside an arm, an else that follows a ; belongs to the case, not to an if in front of it: in 1: if ok then go; else stop the else is the one of the case. Everywhere else an if behaves as before.
  • A negative integer constant in the interface of a unit, such as KEY_UP = -1, was seen as 1 from every other module, with nothing reported: the unit's symbol file (.bsf) got the value without its sign. It is written with the sign now. A .bsf from an older build still holds the wrong value, so compile the unit again.
case key of
  KE_KEY2:          y := y - 1;
  KE_KEY4, KE_KEY6: x := x + key - KE_KEY5;
  0..31:            delay(50);
else
  x := 0;
  y := 0;
end;

Prebuilt binaries for:

  • Linux x86_64 (dynamic and static) and ARM64 (static)
  • Android arm64-v8a, armeabi-v7a and x86_64 (API 21, NDK r29; the 64-bit ones use 16 KB-aligned LOAD segments)

All six were verified by compiling Selftest in both math modes, the full CatchRect project and two case test programs, one of them with a unit: every build writes byte-identical class files, they carry the required StackMap attributes, and CatchRect comes out the same as with 3.5.3. The case programs were also run on a desktop JVM with bytecode verification on, 144 checks of which arm is taken, and Selftest, which now covers case, was run in the ANPASIDE emulator.

Full Changelog: 3.5.3...3.5.4