[Lngcompiler-commits] CVS: lngcompiler LngForm.pas,1.9,1.10
Brought to you by:
lovetski,
maximmasiutin
|
From: Andrew K. L. <lov...@us...> - 2002-06-15 16:22:45
|
Update of /cvsroot/lngcompiler/lngcompiler
In directory usw-pr-cvs1:/tmp/cvs-serv19979/lngcompiler
Modified Files:
LngForm.pas
Log Message:
Error messages now display the line numbers starting from 1, not from "0".
Index: LngForm.pas
===================================================================
RCS file: /cvsroot/lngcompiler/lngcompiler/LngForm.pas,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** LngForm.pas 18 May 2002 16:14:40 -0000 1.9
--- LngForm.pas 15 Jun 2002 16:22:42 -0000 1.10
***************
*** 451,455 ****
if T = nil then
begin
! Errors.Add(Format('Line %5.5d: WARNING: no FORM data collected', [CollectStart]));
Exit;
end;
--- 451,456 ----
if T = nil then
begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: WARNING: no FORM data collected', [CollectStart+1]));
Exit;
end;
***************
*** 460,464 ****
if (T.S = '') or (T.S[1] in ['0'..'9']) then
begin
! Errors.Add(Format('Line %5.5d: ERROR: a form name cannot start with a digit or be empty', [T.Line]));
F.Free;
Exit;
--- 461,466 ----
if (T.S = '') or (T.S[1] in ['0'..'9']) then
begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: a form name cannot start with a digit or be empty', [T.Line+1]));
F.Free;
Exit;
***************
*** 468,472 ****
if (T <> nil) and (T.ID = tidString) then
try
! if T.S = '' then Errors.Add(Format('Line %5.5d: WARNING: no FORM caption found', [T.Line]));
F.Caption := T.S;
AForms.Add(F);
--- 470,475 ----
if (T <> nil) and (T.ID = tidString) then
try
! // Line numbers should start from "1", not from "0" (hence, "+1")
! if T.S = '' then Errors.Add(Format('Line %5.5d: WARNING: no FORM caption found', [T.Line+1]));
F.Caption := T.S;
AForms.Add(F);
***************
*** 486,495 ****
if (CP = '') or (CP[1] in ['0'..'9']) then
begin
! Errors.Add(Format('Line %5.5d: ERROR: control name cannot start with a digit', [LastLine]));
end else
begin
if F.Items.IndexOf(CP) >= 0 then
begin
! Errors.Add(Format('Line %5.5d: ERROR: duplicate control name: %s', [LastLine, T.S]));
end else
begin
--- 489,500 ----
if (CP = '') or (CP[1] in ['0'..'9']) then
begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: control name cannot start with a digit', [LastLine+1]));
end else
begin
if F.Items.IndexOf(CP) >= 0 then
begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: duplicate control name: %s', [LastLine+1, T.S]));
end else
begin
***************
*** 505,518 ****
until (T = nil) or (T.ID <> tidString);
if LI.Text.Count = 0 then
! Errors.Add(Format('Line %5.5d: Warning: no strings defined for the control "%s"', [LLine, LI.Name]));
end;
end;
end else
begin
! Errors.Add(Format('Line %5.5d: ERROR: the name of a control must be an ID, not a string', [T.Line]));
end;
end else
begin
! Errors.Add(Format('Line %5.5d: ERROR: cannot find the control name', [LastLine]));
end;
end;
--- 510,526 ----
until (T = nil) or (T.ID <> tidString);
if LI.Text.Count = 0 then
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: Warning: no strings defined for the control "%s"', [LLine+1, LI.Name]));
end;
end;
end else
begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: the name of a control must be an ID, not a string', [T.Line+1]));
end;
end else
begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: cannot find the control name', [LastLine+1]));
end;
end;
***************
*** 521,530 ****
end else
begin
! Errors.Add(Format('Line %5.5d: ERROR: cannot find the form caption', [LastLine]));
F.Free;
end;
end else
begin
! Errors.Add(Format('Line %5.5d: ERROR: the name of a form must be an ID, not a string', [T.Line]));
F.Free;
end;
--- 529,540 ----
end else
begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: cannot find the form caption', [LastLine+1]));
F.Free;
end;
end else
begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: the name of a form must be an ID, not a string', [T.Line+1]));
F.Free;
end;
***************
*** 600,612 ****
F.Strings.AddObject(UpperCase(CP), LI);
end else
! Errors.Add(Format('Line %5.5d: ERROR: duplicate identifier "%s"', [LLine, CP]));
end else
! Errors.Add(Format('Line %5.5d: ERROR: an identifier found when a string expected', [LastLine]));
end else
! Errors.Add(Format('Line %5.5d: ERROR: undefined identifier (no corresponding string detected)', [LastLine]));
end else
! Errors.Add(Format('Line %5.5d: ERROR: an identifier cannot start with a digit', [T.Line]));
end else
! Errors.Add(Format('Line %5.5d: ERROR: unexpected string "%s" when identifier expected', [T.Line, T.S]));
end;
until T = nil;
--- 610,627 ----
F.Strings.AddObject(UpperCase(CP), LI);
end else
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: duplicate identifier "%s"', [LLine+1, CP]));
end else
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: an identifier found when a string expected', [LastLine+1]));
end else
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: undefined identifier (no corresponding string detected)', [LastLine+1]));
end else
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: an identifier cannot start with a digit', [T.Line+1]));
end else
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: ERROR: unexpected string "%s" when identifier expected', [T.Line+1, T.S]));
end;
until T = nil;
***************
*** 648,652 ****
case CT of
ctForm: begin
! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the FORM definition', [aLine, Msg]));
AnalyzeTokens;
Collecting := 1;
--- 663,668 ----
case CT of
ctForm: begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the FORM definition', [aLine+1, Msg]));
AnalyzeTokens;
Collecting := 1;
***************
*** 654,668 ****
end;
ctStrings: begin
! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the STRINGS definition', [aLine, Msg]));
AnalyzeTokens;
Collecting := 2;
CollectStart := aLine;
end;
! ctEndStrings: if Collecting = 1 then Errors.Add(Format('Line %5.5d: WARNING: the ENDSTRINGS found when ENDFORM expected', [aLine]))
else begin
AnalyzeTokens;
Collecting := 0;
end;
! ctEndForm: if Collecting = 2 then Errors.Add(Format('Line %5.5d: WARNING: the ENDFORM found when ENDSTRINGS expected', [aLine]))
else begin
AnalyzeTokens;
--- 670,687 ----
end;
ctStrings: begin
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: WARNING: the %s is not closed before the STRINGS definition', [aLine+1, Msg]));
AnalyzeTokens;
Collecting := 2;
CollectStart := aLine;
end;
! // Line numbers should start from "1", not from "0" (hence, "+1")
! ctEndStrings: if Collecting = 1 then Errors.Add(Format('Line %5.5d: WARNING: the ENDSTRINGS found when ENDFORM expected', [aLine+1]))
else begin
AnalyzeTokens;
Collecting := 0;
end;
! // Line numbers should start from "1", not from "0" (hence, "+1")
! ctEndForm: if Collecting = 2 then Errors.Add(Format('Line %5.5d: WARNING: the ENDFORM found when ENDSTRINGS expected', [aLine+1]))
else begin
AnalyzeTokens;
***************
*** 718,722 ****
else Msg := 'Symbol';
end;
! Errors.Add(Format('Line %5.5d: WARNING: unexpectected %s while FORM or STRINGS expected', [aLine, Msg]));
end;
end;
--- 737,742 ----
else Msg := 'Symbol';
end;
! // Line numbers should start from "1", not from "0" (hence, "+1")
! Errors.Add(Format('Line %5.5d: WARNING: unexpectected %s while FORM or STRINGS expected', [aLine+1, Msg]));
end;
end;
|