feat: broaden QB45 compatibility across interpreter, mouse, and grab
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 29 Aug 2026 22:54:42 +0000 (01:54 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 29 Aug 2026 22:54:42 +0000 (01:54 +0300)
commit66099d60f2768212523568970cbd5eccd58b3991
tree6324b72aeaf7e9af5a7d43fdaa56d9942aff37c4
parent0b97fa61953b0e4b183ec5563f63873608d9811e
feat: broaden QB45 compatibility across interpreter, mouse, and grab

Driven by making more qbasicapps programs run correctly:

- interp: cross-block GOSUB/RETURN. GosubJump collects the origin
  context chain as it unwinds; RETURN rebuilds the nested origin via a
  pending resume inside the pc loop's try, so enclosing loops keep
  iterating and later GOSUBs still resolve (truth.bas NOT handling)
- interp: Cell stores arrays separately from scalars, so a scalar and
  an array with the same name coexist like in QB45 (3D graph.bas)
- interp: LINE accepts the omitted-start form, drawing from the
  graphics cursor (Interferogram.bas)
- parser: THEN may be omitted before GOTO/GOSUB; punctuation peeks are
  type-aware so string literals like ASC(")") parse (Lottery
  analysis.bas, truth.bas)
- machine: mouse TSR tracks held buttons and re-arms the latch on
  every read-and-reset, like the real per-tick poll (mousedrv.bas)
- frontend: one transparent grab overlay per screen fixes cursor
  escape on multi-monitor setups; mouseReleased forwarded as button-up;
  -Dcrtbasic.grab.auto diagnostic
- drivers: GameDriver gains --block, $ mid-run screenshot token, and
  b<n>- mouse release token
- tests: regression coverage for all of the above
Documentation/language/index.org
src/main/java/eu/svjatoslav/crtbasic/ast/Ast.java
src/main/java/eu/svjatoslav/crtbasic/frontend/SwingFrontend.java
src/main/java/eu/svjatoslav/crtbasic/interp/Interpreter.java
src/main/java/eu/svjatoslav/crtbasic/machine/QbextMouseTsr.java
src/main/java/eu/svjatoslav/crtbasic/parser/Parser.java
src/test/java/eu/svjatoslav/crtbasic/drivers/GameDriver.java
src/test/java/eu/svjatoslav/crtbasic/interp/InterpreterFeaturesTest.java
src/test/java/eu/svjatoslav/crtbasic/interp/MouseDriverEmulationTest.java