Skip to content

Build or triage every code sample; import/export fixes - #196

Merged
KubaO merged 35 commits into
twinbasic:mainfrom
KubaO:staging
Sep 23, 2026
Merged

KubaO merged 35 commits into
twinbasic:mainfrom
KubaO:staging

Conversation

@KubaO

@KubaO KubaO commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Code samples

  • 1,116 of the 1,168 code samples now build, up from 818, in about 110 seconds.
  • Each of the other 52 is marked inert= with its reason, so no sample is undecided.
  • Fixed samples that were wrong rather than incomplete, among them Generics, the Arrays tutorial and Screen.
  • Dim x As New Foo(args) is a syntax error, so those samples now use Set x = New Foo(args).
  • Samples using a package's private types or enums import it with an asterisk, and each page explains how.
  • The CustomControls tutorials use the serializer's current names and read designer values through GetSerializer.
  • The Painting tutorial's samples build, with Canvas members under their real names.
  • Samples declare their locals, put loose statements in a Sub, and write elisions as ' ....
  • The last excerpts build, showing what the reader writes and hiding what they bring from elsewhere.
  • Interface and Err.Source no longer show code that a compiler bug refuses.

Import and export

  • impexp export now converts LF to CRLF in .twin, .bas and .cls files, as the compiler's import does.
  • Every other file is still stored byte-for-byte, so resources are never altered.
  • The Import/Export Tool page describes this conversion for both tools.
  • It also documents that the compiler's import fails, with exit code 999, on any project that embeds a package.
  • The standalone scripts pack such a project correctly, and the page's comparison table says so.
  • The page no longer claims the compiler's exit code is always zero.

Tooling

  • check_examples gains inert=<reason>, to record why a fence is not a program.
  • resource= stages a file the compiler reads, so [PopulateFrom] is checked against its page's JSON.
  • concat_group= joins one construct shown across several fences into a single unit.
  • --report groups a saved survey by diagnostic, section, undeclared symbol and page.
  • A diagnostic inside a package's own source is traced to the sample that caused it, which used to pass.
  • New templates import CustomControls, WinNativeCommonCtls and CEF with an asterisk; implicit turns Option Explicit off.
  • The stage set gains 61 declarations for the controls and objects the samples assume.
  • The classifier reads top-level Implements and Inherits as class code-behind, and . . . as an elision.
  • A sample may bring its own Sub Main; the rule against it was never true.
  • check_examples explains the EPERM that a dead run's leftover IDEs cause.
  • tbrun, check_examples and the attribute census test the compiler's output for ... DONE, not its exit code.
  • tbrun no longer reports a packing failure as compile errors, and the census no longer caches a failed export.

Bugs queued in BUGS-TO-REPORT.md

  • Public members are typed with private components, so a default project cannot use them.
  • Err.Raise rejects HelpContext:=, although its other named arguments work.
  • A class cannot implement an interface member marked [PreserveSig].
  • The compiler's import stops with exit code 999 on a tree that embeds a package.
  • export and import stop at the 260-character path limit, and still exit 0.

Notes

  • Authoring.md explains the new markers, finishing a sample that is one line short, and what to hide.
  • Authoring.md adds a rule: document the product as it is, not as it was.
  • WIP.ExamplesBuild.md records the marking, editorial and excerpt passes.
  • The attribute census is re-measured at 661 files and 9,701 sites.

…atable(False) on a generated Class; 50 more stage entries
…Len/ArrayPtr returned nothing, Caster was called Example, a skip is an omitted argument
…eFrom] is checked against the JSON its page prints
…to one unit, identified by its first visible part
…s builds, and Canvas members go by their real names
…ough GetSerializer, not a serialization constructor
…example stops trying, both pages say so, and it is queued to report
…mpiler's own import does -- the page says so for both
…ge -- the page says so, stops claiming the exit code is always zero, and it is queued to report
…r the exit code -- tbrun and check_examples stop dying on import's 999, and the census stops caching failed exports
…census re-measured at 661 files and 9,701 sites, here and in Tools.md; one dead anchor fixed
@KubaO
KubaO merged commit 8c0856d into twinbasic:main Sep 23, 2026
1 check passed
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