declaring a parameter as 'name-: TYPE' passes it by reference for
efficiency but prevents assignment within the procedure body.
per xds oberon-2 documentation, '-' is a modifier on value parameters
only; combining it with VAR is an error (246).
adding 'readOnlyPar = 3' to the vis field constants on OPT.Object.
setting node^.readonly in OPB.Ident for VarPar nodes whose object
has vis = readOnlyPar, which causes OPB.Assign to emit err(76) on
any attempt to write the parameter or its components.
relaxing OPB.Param to allow passing a read-only variable as an
actual argument to a read-only formal (previously blocked by err(76)
because VarPar checked ap^.readonly unconditionally).
adding Srpar = 42 symbol file tag so that read-only parameters
survive across module boundaries: OutSign writes Srpar and InSign
reconstructs the mode and vis correctly when importing.
code generation in OPV is unchanged; read-only parameters produce
the same C as VAR parameters since the restriction is purely semantic.
passing a 2d static array to an open array parameter generated no
(void*) cast, because the condition only checked for VarPar mode.
adding a check for whether the formal element type is composite
(typ^.BaseTyp^.form = OPT.Comp) catches the pointer-indirection
mismatch for nested arrays, matching the fix in ofrontplus fe43645.
assigning a pointer-to-extension to a pointer-to-base failed to
cast when the pointer type was anonymous (strobj = NIL). falling
back to casting through the base type's strobj when the pointer
type itself has no name, matching the fix in ofrontplus 69e7660.
fixes issue #105.
gentoo (and possibly others) write ID='gentoo' with single quotes in
/etc/os-release. ParseOsRelease was only stripping double quotes and
using ascii comparison to find the end of the value, which caused
single quotes to be embedded in the os string, producing invalid oberon
like os* = ''gentoo''.
stripping both quote styles at start and stopping at either kind at end.
works for unquoted values (raspbian, devuan) and double-quoted values too.
the crash was introduced in aed9134e: when the rhs of an array assignment
is a pointer-dereferenced dynamic array (e.g. s^), the rhs node has no
named obj, so obj is nil. the dynArr branch in OPV was calling OPC.Len
which dereferences obj immediately, causing a segfault in the compiler.
OPV already has a Len() procedure that handles Nderef nodes by generating
ptr->len[dim] instead of relying on a named obj. switching to that call
fixes the crash and generates correct bounds-checked C code.
removing the err(113) workaround in OPB.CheckAssign that was suppressing
the crash by rejecting valid oberon-07 assignments.
fixes issue #55.