From 93340f97dce404a008f489729df144ace53528ab Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 10:38:17 +0000 Subject: fix std hover, full capture terminator, bare static calls, void main in run-only images - hover: a symbol from an embedded library source (tinyvm:std.zc, tinyvm:icon.zc) was looked up only in the document; look it up by its qualified name in the library source (hover_embedded_sym), and render a method found that way by its line (bs_hover). - std.capture: allocate one word more than the 256 it holds, so end() terminates inside the buffer. - a bare call to a static function of the enclosing struct resolves like a bare struct constant (mstruct is set for every non-generic struct's methods); the struct's own wins over a global. - run.zc declares main untyped (fn main();), so a run-only image accepts int, void or untyped main with both compilers. --- tests/programs/void_main.zc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/programs/void_main.zc (limited to 'tests/programs/void_main.zc') diff --git a/tests/programs/void_main.zc b/tests/programs/void_main.zc new file mode 100644 index 0000000..b4fde70 --- /dev/null +++ b/tests/programs/void_main.zc @@ -0,0 +1,8 @@ +namespace; +include rt; + +// main may be declared void: the runtime ignores what main returns (docs/SPEC.md 5.2.5, 8.1.3), +// so a run-only image, whose run.zc declares int main();, accepts it as zy does. +void main() { + rt.put_s("void main"); rt.put_c(10); +} -- cgit v1.2.3