mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 01:42:24 +00:00
Undecl var fix (#74)
* fix like 78036911d2
* OPT.DynArr to be precise
* removed PromoteIntConstToLInt() function call
* update of bootstrap sources.
This commit is contained in:
parent
760e14bbe1
commit
6ae2f96d08
187 changed files with 323 additions and 242 deletions
|
|
@ -1215,12 +1215,15 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *)
|
|||
END IntLiteral;
|
||||
|
||||
PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: SYSTEM.INT64);
|
||||
VAR
|
||||
d: SYSTEM.INT64;
|
||||
BEGIN
|
||||
d := dim;
|
||||
WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END;
|
||||
IF array^.comp = OPT.DynArr THEN
|
||||
CompleteIdent(obj); OPM.WriteString(LenExt);
|
||||
IF dim # 0 THEN OPM.WriteInt(dim) END
|
||||
ELSE (* array *)
|
||||
WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END;
|
||||
OPM.WriteInt(array.n)
|
||||
END
|
||||
END Len;
|
||||
|
|
|
|||
|
|
@ -208,10 +208,18 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
|||
PROCEDURE^ design(n: OPT.Node; prec: INTEGER);
|
||||
|
||||
PROCEDURE Len(n: OPT.Node; dim: SYSTEM.INT64);
|
||||
VAR
|
||||
d: SYSTEM.INT64; array: OPT.Struct;
|
||||
BEGIN
|
||||
WHILE (n^.class = OPT.Nindex) & (n^.typ^.comp = OPT.DynArr(*26.7.2002*)) DO INC(dim); n := n^.left END ;
|
||||
IF (n^.class = OPT.Nderef) & (n^.typ^.comp = OPT.DynArr) THEN
|
||||
design(n^.left, 10); OPM.WriteString("->len["); OPM.WriteInt(dim); OPM.Write("]")
|
||||
d := dim; array := n^.typ;
|
||||
WHILE d > 0 DO array := array^.BaseTyp; DEC(d) END;
|
||||
IF array^.comp = OPT.DynArr THEN
|
||||
design(n^.left, 10); OPM.WriteString("->len["); OPM.WriteInt(dim); OPM.Write("]")
|
||||
ELSE
|
||||
OPM.WriteInt(array^.n)
|
||||
END
|
||||
ELSE
|
||||
OPC.Len(n^.obj, n^.typ, dim)
|
||||
END
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue