From ca9f1df16979ed5bf449a0f76c816bf821eacf4f Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Sat, 10 Oct 2026 10:53:20 +0000 Subject: [PATCH] Report: no F32 to ..., doc comments; plan: a doc tool and checked examples --- diff --git a/PLAN.md b/PLAN.md index ed35bc1..71e2ce3 100644 --- a/PLAN.md +++ b/PLAN.md @@ -127,7 +127,17 @@ - [ ] 14. Line numbers for gdb: `.debug_line`, with the least of `.debug_info` and `.debug_abbrev` that gdb needs. +Tools + +- [ ] 15. `tools/Doc.jed`, a jed program: prints a module's exported + declarations, each with the comment just before it, and pulls + out the examples of `doc/jed.md` that are whole modules. + `make check` also compiles those examples, running the ones with + a `main`, and runs each library module's `main` as its test. + The test runner stays in the Makefile: it must work when the + compiler doesn't. + Wrap up -- [ ] 15. `README.md` and `doc/compiler.md`, a guide to reading the +- [ ] 16. `README.md` and `doc/compiler.md`, a guide to reading the compiler file by file. diff --git a/doc/jed.md b/doc/jed.md index a2ec198..43556ac 100644 --- a/doc/jed.md +++ b/doc/jed.md @@ -77,7 +77,8 @@ Error messages give the line and the column, counted in characters. -**Comments** are `(*` ... `*)` and nest. +**Comments** are `(*` ... `*)` and nest. By convention, the comment +just before an exported declaration is its documentation. **Operators and delimiters:** @@ -735,8 +736,9 @@ An `extern` procedure's parameters and result are integers, `BOOL`, `F32`, `F64`, pointers or procedures; a record goes to C by pointer, never by value. `...` accepts any number of further arguments of those -types, and is allowed only in an `extern`. As C does, an `F32` given -to `...` is passed as an `F64`, and a real constant there is an `F64`. +types, and is allowed only in an `extern`. C takes no `float` there, +so an `F32` given to `...` is an error: the program writes `F64(x)`. +A real constant there is an `F64`. An `extern` variable is C's variable itself: reading it reads C's, assigning it writes C's. It can be of any type, declared as C declares