Skip to content

Preserve dialect semantics through IR and x86-16 - #2

Closed
Hawkynt wants to merge 15 commits into
mainfrom
agent/dialect-ir-x86-backend
Closed

Preserve dialect semantics through IR and x86-16#2
Hawkynt wants to merge 15 commits into
mainfrom
agent/dialect-ir-x86-backend

Conversation

@Hawkynt

@Hawkynt Hawkynt commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve dialect selection through IR lowering and the x86-16 backend instead of silently changing semantics at the backend boundary
  • enforce BASICA/GW-BASIC physical line numbering, numeric-only labels, and the absence of later structured syntax
  • represent interpreter-tolerated source text explicitly: warn when it is stored, compile it only when static control flow proves it unreachable, and fail emission when it may execute
  • split dialect gates for structured statements, named labels, EXIT FAR, compiler metastatements, and tuple destructuring
  • add an exhaustive statement-form × dialect census plus a structural invalid-syntax matrix, including constructs valid in another dialect
  • generate compile-only oracle cases/manifests for vintage compilers and add BASICA/GW runtime oracle fixtures for deferred dead text
  • document the conformance workflow and oracle controls

Validation

GitHub Actions run 591:

  • restore and build pass on Windows and Ubuntu
  • Windows core suite: 3,485 passed; Ubuntu core suite: 3,712 passed
  • all new dialect, invalid-syntax, deferred-source, IR, x86-16, and census tests pass
  • eight pre-existing C-backend battery failures remain on each runner (float prototype mismatch, missing rt_str_dup, and unsupported ON ERROR block addresses); they are unrelated to this x86-16/dialect tranche

The repository image does not include a local .NET SDK, so execution validation is performed in Actions.

@Hawkynt Hawkynt changed the title Preserve BASIC dialect semantics through IR and x86-16 Preserve dialect semantics through IR and x86-16 Aug 6, 2026
@Hawkynt

Hawkynt commented Aug 7, 2026

Copy link
Copy Markdown
Owner Author

Integrated into main (e38aa8a). Every commit from this branch is now an ancestor of main.

Four fixes were needed on top to make the tree green; all four are in that commit:

  • Microsoft comment metacommands leaked into the PowerBASIC family. The gate's note said the Borland minimum was unused because the lexer only recognises the syntax in the Microsoft family, but IsAvailable consults the Borland table for a Borland dialect, so the pb36 minimum switched it on for pb36. Any unrecognised $word after a comment marker then became a hard parse error, and six differential-battery sources stopped compiling — they describe the $OPTIMIZE/$ERROR/$CPU they use, in prose, in comments. The lexer now checks the family.
  • $COMPAT was gated at pb36 while the decompiler emits it for a pb35 recompile, so BasicWriter's own output could not be read by roundtrip-check.sh, which recompiles at pb35. Gate moved to pb35 along with the surface table and the Pb35/Pds71 pair audit.
  • REM $INCLUDE treated the colon as optional, so REM $INCLUDE 'INC.BI' silently pulled the file in rather than being reported. Required now, which is what this branch's own test asserted.
  • $DIM ALL/$DIM ARRAY validated its argument but not the dialect, so Turbo Basic and PB 2.x accepted a statement docs/DIALECTS.md lists under PB 3.0. Gated there.

One test here was self-contradictory rather than wrong about the compiler: it tokenised REM $STATIC under BASICA/GW to prove the text stays a comment, while the same change made a numeric line number mandatory there. It now carries one and asserts that no metacommand token is produced.

Final state on main: round-trip gate 252/0, suite 4153 passing with only the 8 long-standing CBackendTests failures (rt_print_single declared long double against a float), which predate this branch.

@Hawkynt Hawkynt closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant