feat: add console INPUT, BEEP, nested-label GOTO and screen fixes master
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 22 Aug 2026 15:28:12 +0000 (18:28 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sat, 22 Aug 2026 15:28:12 +0000 (18:28 +0300)
commitfe86c0035df584b8c981c5155fb8cd46a75991da
tree0255fe2614b131bd099bed0be4292735eabd86cc
parent9a2e354c3d4a19ce9069376e8f1c465aac7350d3
feat: add console INPUT, BEEP, nested-label GOTO and screen fixes

- Console INPUT: prompt with ';' (adds "? ") or ',' (prompt only),
  echoed line editing with Backspace, comma-delimited items; headless
  runs give up after 5 s of silence instead of hanging.
- BEEP desugars to SOUND 800, 4.55 (the classic ~1/4 s beep).
- GOTO may jump INTO a label nested in IF/FOR/DO bodies with flat
  QBasic semantics: headers are not re-evaluated and enclosing loops
  resume with current variable values (checkers2.bas "GoTo 8").
- AS-typed SUB/FUNCTION parameters claim their bare name inside the
  body (winning over DEFxxx defaults), while suffix parameters like
  a$ leave the bare name as a distinct DEFxxx-typed variable.
- Bare SUB calls accept a parenthesized first argument; the parens
  parse as grouping and the comma list continues the arguments.
- Graphics modes default the foreground to the mode's highest
  attribute (1/3/15/255) instead of always 15, so colorless PAINT
  stays inside the walls (checkers.bas SCREEN 2 flood); SCREEN 2's
  palette now maps attribute 1 to white.
- 640x200 modes (SCREEN 2, 8) are doubled vertically in the Swing
  window and in dumpPng to match their 4:3 CRT pixel aspect; the
  window re-packs on every mode switch via a mode listener.
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/parser/Parser.java
src/main/java/eu/svjatoslav/crtbasic/video/DefaultPalettes.java
src/main/java/eu/svjatoslav/crtbasic/video/ScreenMode.java
src/main/java/eu/svjatoslav/crtbasic/video/VgaDevice.java
src/test/java/eu/svjatoslav/crtbasic/interp/InterpreterFeaturesTest.java
src/test/java/eu/svjatoslav/crtbasic/video/VgaDeviceTest.java