prevents orphaned or misplaced comments from being written to symbol

files.
This commit is contained in:
Norayr Chilingarian 2025-07-19 05:56:37 +04:00
parent a517a42357
commit 84516b2ac6

View file

@ -1348,6 +1348,8 @@ BEGIN
IF obj^.mode IN {Con, Typ, Var, LProc, XProc, CProc, IProc} THEN
(* Write comment BEFORE the object *)
IF obj^.comment # NIL THEN
(* Only write comments for objects that make sense *)
IF (obj^.mode IN {Con, Typ, Var, XProc, IProc, CProc}) & (obj^.vis # internal) THEN
OPM.SymWInt(Scomment);
(* Calculate actual length of comment text *)
k := 0;
@ -1358,6 +1360,8 @@ BEGIN
WHILE l < k DO
OPM.SymWCh(obj^.comment^[l]); INC(l)
END
END
(* If condition is false, we skip the comment entirely *)
END;
IF obj^.history = removed THEN FPrintErr(obj, 250)