Suite 173/173; self-hosting fixpoint OK (image
2,785,569 bytes). Work on items 2 (result suffixes), 4
(coroutines) and 6 (library holes) of the remaining-gaps list; items
1 (GOTO), 3 (generics) and 5 (multiple inheritance) were left alone.
F()^, F()[i], F().field)New ResultComp production (M2.atg) applied to a call result inside
Fact: the [ ArgList { ResultComp } ] group is entered only when the
lookahead is (, so the component starters [ . ^ stay disjoint from
Design's own component loop (no new Coco/R LL(1) conflict). After a
call the result is in t/q with sfx := FALSE; ^ dereferences a
pointer result, [i] indexes an array result, .f selects a record
field, and a final scalar is loaded with ElemLoad. Expression context
only; statement-context suffix targets and chained post-call calls are
not accepted.
SYSTEM.NEWPROCESS/TRANSFER/IOTRANSFER)PROCESS is predefined pointer-sized; PROC is a new parameterless
procedure-type descriptor (dProc).NEWPROCESS, TRANSFER, IOTRANSFER are predefined external
procedures (SymTab.PredefCProc/AddFormal) with explicit
signatures; calls bind to m2_newprocess/m2_transfer/
m2_iotransfer.ucontext: NEWPROCESS builds a
context on the caller's workspace, TRANSFER saves/resumes.
IOTRANSFER degrades to a transfer (no interrupt subsystem).ElemLoad/ElemStore and the function-parameter prologue treated
procedure values (and LONGINT) as 32-bit; they are now loadl/
storel (ClProc, ClClass, ClLong). This fixes arrays of
procedure values (StdIO's push/pop stacks) and proc/long formals.compiler.frm).Math.ln/Math.arctan now wrap the C log/atan (they bound to
non-existent ln/arctan).Added: ConvTypes, IOConsts, SIOResult, TERMINATION, StrIO,
InOut, StdIO, WholeStr, RealStr, LongStr, LongMath,
STextIO, SWholeIO, SRealIO, LongIO, DynamicStrings (core
subset), SysStorage. TERMINATION.def is uppercase (gm2 spelling).
New shim helpers: m2readline, m2writeintwidth, m2realconv,
m2terminating, m2hashalted, and the m2ds* DynamicStrings core
(heap C strings; String is an opaque type completed to ADDRESS).
Still missing from the §2 list: LongWholeIO, wrapclock/wraptime/
wrapc, TimeString, and the gm2 device framework (ChanConsts/
GenDevIF/DeviceTablePtr/StdChans/StreamFile/FIO).
New: t_resultsfx (deref/index/field of call results), t_coroutine
(two coroutines ping-pong), t_dynstr (DynamicStrings + SysStorage),
library1 (a session exercising 16 library modules).
cd .../m2compiler-V3
./bootstrap/fixpoint.sh # FIXPOINT OK
cd compiler && ./build.sh && ./run_tests.sh # 173/173
GOTO/labels, generics, multiple inheritance (deliberate), full
forward variables, statement-context result suffixes, and the channel/
device library holes listed above.