ソースを参照

docs: update README and comparison for v3-ptrchain

Record PACKEDSET, ISO exceptions and self-referential pointer records in the README; update the comparison state to v3-ptrchain, note chained pointer designators and catchable rangeException traps.
Eric Streit 1 日 前
親
コミット
8a237ec724
2 ファイル変更、22 行追加、11 行削除
  1. 10 2
      README.md
  2. 12 9
      docs/comparison-PIM4-gm2-V3.md

+ 10 - 2
README.md

@@ -51,15 +51,23 @@ docs/              STATUS.md, plan.md, plan-*.md, analysis_*.md, summary_*.md
   stage2/stage3, 4,143,847 bytes); corpus **512/612 compile-OK,
   0 crashes** (`tools/v3-corpus`; the corpus is gm2's testsuite, so it
   mixes conforming Modula-2 with gm2 leniencies — see `docs/gaps/`).
-- Active branch **`master`**.
+  `lazyunique` now runs; the remaining `except*` corpus files still hit
+  V3's declaration-order policy.
+- Active branch **`master`**, feature state **`v3-ptrchain`**.
+  Recent milestones: `PACKEDSET`, ISO exceptions (`EXCEPT`/`RETRY`,
+  `EXCEPTIONS`, `M2EXCEPTION`, catchable language traps), and
+  self-referential pointer records/chained fields.
 
 Lowers today: program modules; `CONST`/`VAR`/`TYPE` (scalars,
-subranges, enums, arrays, records incl. variants, sets, pointers);
+subranges, enums, arrays, records incl. variants and self-referential
+pointer records, sets incl. `PACKEDSET`, pointers);
 `ARRAY`/`RECORD`/`SET`/`POINTER`, `WITH`, `IN`; whole array/record
 copy; `NEW`/`DISPOSE`; all scalar arithmetic, relations, boolean
 connectives; `IF/CASE/WHILE/REPEAT/LOOP/FOR`, `GOTO`/labels;
 procedures with value/`VAR` params, functions, recursion, `FORWARD`,
 nested procedures (static-link display), procedure values;
+ISO exceptions (`EXCEPT`/`RETRY`, `SYSTEM.THROW`, `EXCEPTIONS`,
+`M2EXCEPTION`, catchable index/range/CASE traps);
 Clarion-form `CLASS` with methods, inheritance and virtual dispatch;
 PIM coroutines (`PROCESS`/`NEWPROCESS`/`TRANSFER`/`IOTRANSFER`);
 Unicode (`UCHAR` codepoints, `UString`, UTF-8 at the edges); ISO type

+ 12 - 9
docs/comparison-PIM4-gm2-V3.md

@@ -1,6 +1,6 @@
 # PIM4 vs GNU Modula-2 vs M2R10 vs TopSpeed V3 vs V3 — feature comparison
 
-**Date:** 2026-10-23 · **V3 state:** `v3-packedset` (suite
+**Date:** 2026-10-23 · **V3 state:** `v3-ptrchain` (suite
 276/276, self-hosting fixpoint OK 4,143,847 bytes, corpus 512/612,
 0 crashes).
 
@@ -76,9 +76,9 @@ change individual cells.
 | Fixed / multi-dimensional arrays | ✅ `[a], [b] OF` | ✅ | ✅ `ARRAY count, count OF` (zero-based) | ✅ | ✅ both `[a], [b]` and `[a, b]` |
 | Open arrays (1-D) | ✅ | ✅ | ✅ (`BARE ARRAY OF`) | ✅ | ✅ |
 | Multi-dimensional open arrays | ❌ (ISO addition) | ✅ | 🔄 one-dimensional `BARE` arrays | ❌ | ❌ (descriptor-per-level representation) |
-| Records | ✅ | ✅ | ✅ extensible | ✅ | ✅ |
+| Records | ✅ | ✅ | ✅ extensible | ✅ | ✅ (incl. self-referential pointer fields) |
 | Variant records | ✅ | ✅ | ❌ removed (extensible records replace them) | ✅ | ✅ (plus empty arms/`ELSE`) |
-| Pointers, `NIL`, opaque types | ✅ | ✅ | ✅ (`OPAQUE` keyword) | ✅ | ✅ |
+| Pointers, `NIL`, opaque types | ✅ | ✅ | ✅ (`OPAQUE` keyword) | ✅ | ✅ (incl. chained `p^.next^.value`) |
 | Procedure types | ✅ (`PROCEDURE`) | ✅ (`PROCEDURE`, `PROC`) | ✅ (comma-separated formals) | ✅ | ✅ (`PROCEDURE`, `PROC`; comma/unnamed forms) |
 | Complex types (`COMPLEX`, `LONGCOMPLEX`) | ❌ | ✅ (ISO) | ❌ (not in the base R10 grammar) | ❌ | ❌ (`COMPLEX64` is a `REAL` placeholder) |
 | SYSTEM sized types (`WORD32`, `CARDINAL8`, `BITSET32`, …) | ❌ | ✅ | 🔄 `OCTET` (8-bit), `LONGCARD`, `LONGBITSET` | 🔄 `SHORTINT`/`LONGINT`/`SHORTCARD`/`LONGCARD` family | ✅ 8/16/32 names; `WORD`/`WORD32` 32-bit |
@@ -100,7 +100,7 @@ change individual cells.
 | `LENGTH` | ❌ (ISO adds it) | ✅ | 🔄 library/pervasive, not in the base grammar | ❌ | ✅ |
 | `HIGH` | ✅ | ✅ | ❌ (not in the R10 grammar) | ✅ | ✅ (including string `CONST`) |
 | `TSIZE`/`SIZE`/`ADR` | ✅ | ✅ | 🔄 SYSTEM/library forms | ✅ | ✅ |
-| Runtime subrange range checks | ⚠️ error per language; checks implementation-defined | ✅ | ✅ (R10 safety) | 🔄 | ✅ assignment/value actual/`RETURN`/`INC`/`DEC`; `FOR` final increment exempt |
+| Runtime subrange range checks | ⚠️ error per language; checks implementation-defined | ✅ | ✅ (R10 safety) | 🔄 | ✅ assignment/value actual/`RETURN`/`INC`/`DEC`; catchable `rangeException`; `FOR` final increment exempt |
 | `SHIFT`/`ROTATE` | ⚠️ implementation SYSTEM extension | ✅ | ❌ | ✅ (`<<`/`>>` operators) | ✅ |
 | `TBITSIZE` | ❌ | ✅ | ❌ | ❌ | ❌ |
 | ISO exceptions (`EXCEPT`, `RETRY`, `EXCEPTIONS`) | ❌ | ✅ | ❌ (not in the base R10 grammar) | ❌ | 🔄 `EXCEPT`/`RETRY`/`SYSTEM.THROW`, `EXCEPTIONS`/`M2EXCEPTION`, index/range/CASE traps; `functionException`/`FINALLY` pending |
@@ -158,6 +158,8 @@ change individual cells.
   finalization/protection, multi-dimensional open arrays, ISO OO** and
   parts of the **word model** (`SHORTREAL`, `REAL` width), plus a
   **65536-bit `SET` span limit** and a **32-bit `PACKEDSET` limit**.
+  Self-referential pointer records and chained pointer-field
+  designators (`p^.next^.value`) are supported.
 
 ## V3-specific deviations and limits
 
@@ -174,9 +176,10 @@ change individual cells.
   1/2/4-byte storage with a 32-bit span limit (wider spans are a loud
   `230`).
 - **Runtime range checks** are emitted for subrange assignment, value
-  actuals, `RETURN` and `INC`/`DEC` (`QbeGen.CheckRange`, abort trap).
-  The post-increment of a `FOR` control variable is not checked: the
-  final successor may legitimately exceed a full subrange.
+  actuals, `RETURN` and `INC`/`DEC` (`QbeGen.CheckRange`); they raise a
+  catchable `rangeException`, with an unhandled exception aborting at
+  rc 134.  The post-increment of a `FOR` control variable is not
+  checked: the final successor may legitimately exceed a full subrange.
 - **Multi-dimensional open arrays** are not supported: V3 represents an
   array level as its own descriptor, whereas gm2 passes a flat block —
   accepting the corpus files would compile but miscompile.
@@ -189,8 +192,8 @@ change individual cells.
 ## Sources
 
 - V3: `docs/STATUS.md`, `docs/features.md`, `docs/gaps/README.md`,
-  `docs/analysis_gaps.md`, `docs/summary_session-2026-10-23.md`; the
-  gates in this document were run at `v3-packedset`.
+  `docs/analysis_gaps.md`, `docs/summary_session-2026-10-23-exceptions.md`; the
+  gates in this document were run at `v3-ptrchain`.
 - gm2: the GCC Modula-2 testsuite and `gm2-libs`/`gm2-libs-iso`
   definition modules in the sibling `gcc-git` tree.
 - M2R10: the published R10 grammar (m2r10-grammar.gll) and