mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-05 23:22:25 +00:00
prevents orphaned or misplaced comments from being written to symbol
files.
This commit is contained in:
parent
a517a42357
commit
84516b2ac6
1 changed files with 13 additions and 9 deletions
|
|
@ -1348,16 +1348,20 @@ BEGIN
|
||||||
IF obj^.mode IN {Con, Typ, Var, LProc, XProc, CProc, IProc} THEN
|
IF obj^.mode IN {Con, Typ, Var, LProc, XProc, CProc, IProc} THEN
|
||||||
(* Write comment BEFORE the object *)
|
(* Write comment BEFORE the object *)
|
||||||
IF obj^.comment # NIL THEN
|
IF obj^.comment # NIL THEN
|
||||||
OPM.SymWInt(Scomment);
|
(* Only write comments for objects that make sense *)
|
||||||
(* Calculate actual length of comment text *)
|
IF (obj^.mode IN {Con, Typ, Var, XProc, IProc, CProc}) & (obj^.vis # internal) THEN
|
||||||
k := 0;
|
OPM.SymWInt(Scomment);
|
||||||
WHILE (k < OPM.MaxCommentLen - 1) & (obj^.comment^[k] # 0X) DO INC(k) END;
|
(* Calculate actual length of comment text *)
|
||||||
OPM.SymWInt(k); (* length prefix *)
|
k := 0;
|
||||||
(* Write comment data as individual characters *)
|
WHILE (k < OPM.MaxCommentLen - 1) & (obj^.comment^[k] # 0X) DO INC(k) END;
|
||||||
l := 0;
|
OPM.SymWInt(k); (* length prefix *)
|
||||||
WHILE l < k DO
|
(* Write comment data as individual characters *)
|
||||||
OPM.SymWCh(obj^.comment^[l]); INC(l)
|
l := 0;
|
||||||
|
WHILE l < k DO
|
||||||
|
OPM.SymWCh(obj^.comment^[l]); INC(l)
|
||||||
|
END
|
||||||
END
|
END
|
||||||
|
(* If condition is false, we skip the comment entirely *)
|
||||||
END;
|
END;
|
||||||
|
|
||||||
IF obj^.history = removed THEN FPrintErr(obj, 250)
|
IF obj^.history = removed THEN FPrintErr(obj, 250)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue