mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 15:56:08 +02:00
codetools: save less errors
git-svn-id: trunk@37214 -
This commit is contained in:
parent
855af79e42
commit
1eca771511
@ -152,9 +152,9 @@ type
|
||||
procedure SetScanner(NewScanner: TLinkScanner); virtual;
|
||||
procedure DoDeleteNodes(StartNode: TCodeTreeNode); virtual;
|
||||
procedure CloseUnfinishedNodes;
|
||||
procedure RaiseIdentExpectedButAtomFound;
|
||||
procedure RaiseBracketOpenExpectedButAtomFound;
|
||||
procedure RaiseBracketCloseExpectedButAtomFound;
|
||||
procedure SaveRaiseIdentExpectedButAtomFound;
|
||||
procedure SaveRaiseBracketOpenExpectedButAtomFound;
|
||||
procedure SaveRaiseBracketCloseExpectedButAtomFound;
|
||||
procedure RaiseUndoImpossible;
|
||||
procedure SetIgnoreErrorAfter(const AValue: TCodePosition); virtual;
|
||||
procedure IncreaseTreeChangeStep(NodesDeleting: boolean);
|
||||
@ -866,7 +866,7 @@ end;
|
||||
|
||||
procedure TCustomCodeTool.AtomIsIdentifierSaveE;
|
||||
|
||||
procedure RaiseIdentExpectedButEOFFound;
|
||||
procedure SaveRaiseIdentExpectedButEOFFound;
|
||||
begin
|
||||
SaveRaiseExceptionFmt(ctsIdentExpectedButEOFFound,[GetAtom],true);
|
||||
end;
|
||||
@ -874,9 +874,9 @@ procedure TCustomCodeTool.AtomIsIdentifierSaveE;
|
||||
begin
|
||||
if InternalAtomIsIdentifier then exit;
|
||||
if CurPos.StartPos>SrcLen then
|
||||
RaiseIdentExpectedButEOFFound
|
||||
SaveRaiseIdentExpectedButEOFFound
|
||||
else
|
||||
RaiseIdentExpectedButAtomFound;
|
||||
SaveRaiseIdentExpectedButAtomFound;
|
||||
end;
|
||||
|
||||
function TCustomCodeTool.AtomIsCustomOperator(AllowIdentifier,
|
||||
@ -885,9 +885,9 @@ function TCustomCodeTool.AtomIsCustomOperator(AllowIdentifier,
|
||||
procedure RaiseOperatorExpected;
|
||||
begin
|
||||
if CurPos.StartPos>SrcLen then
|
||||
SaveRaiseExceptionFmt(ctsOperatorExpectedButEOFFound,[GetAtom],true)
|
||||
RaiseExceptionFmt(ctsOperatorExpectedButEOFFound,[GetAtom],true)
|
||||
else
|
||||
SaveRaiseExceptionFmt(ctsOperatorExpectedButAtomFound,[GetAtom],true)
|
||||
RaiseExceptionFmt(ctsOperatorExpectedButAtomFound,[GetAtom],true)
|
||||
end;
|
||||
|
||||
begin
|
||||
@ -1929,7 +1929,7 @@ begin
|
||||
AntiCloseBracket:=cafRoundBracketClose;
|
||||
end else begin
|
||||
if ExceptionOnNotFound then
|
||||
RaiseBracketOpenExpectedButAtomFound;
|
||||
SaveRaiseBracketOpenExpectedButAtomFound;
|
||||
exit;
|
||||
end;
|
||||
Start:=CurPos;
|
||||
@ -1976,7 +1976,7 @@ begin
|
||||
AntiOpenBracket:=cafRoundBracketOpen;
|
||||
end else begin
|
||||
if ExceptionOnNotFound then
|
||||
RaiseBracketCloseExpectedButAtomFound;
|
||||
SaveRaiseBracketCloseExpectedButAtomFound;
|
||||
exit;
|
||||
end;
|
||||
Start:=CurPos;
|
||||
@ -3139,17 +3139,17 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomCodeTool.RaiseIdentExpectedButAtomFound;
|
||||
procedure TCustomCodeTool.SaveRaiseIdentExpectedButAtomFound;
|
||||
begin
|
||||
SaveRaiseExceptionFmt(ctsIdentExpectedButAtomFound,[GetAtom],true);
|
||||
end;
|
||||
|
||||
procedure TCustomCodeTool.RaiseBracketOpenExpectedButAtomFound;
|
||||
procedure TCustomCodeTool.SaveRaiseBracketOpenExpectedButAtomFound;
|
||||
begin
|
||||
SaveRaiseExceptionFmt(ctsBracketOpenExpectedButAtomFound,[GetAtom],true);
|
||||
end;
|
||||
|
||||
procedure TCustomCodeTool.RaiseBracketCloseExpectedButAtomFound;
|
||||
procedure TCustomCodeTool.SaveRaiseBracketCloseExpectedButAtomFound;
|
||||
begin
|
||||
if CurPos.StartPos<SrcLen then
|
||||
SaveRaiseExceptionFmt(ctsBracketCloseExpectedButAtomFound,[GetAtom],true)
|
||||
|
@ -9161,9 +9161,9 @@ function TFindDeclarationTool.CheckParameterSyntax(CursorNode: TCodeTreeNode;
|
||||
procedure RaiseBracketNotOpened;
|
||||
begin
|
||||
if CurPos.Flag=cafRoundBracketClose then
|
||||
SaveRaiseExceptionFmt(ctsBracketNotFound,['('])
|
||||
RaiseExceptionFmt(ctsBracketNotFound,['('])
|
||||
else
|
||||
SaveRaiseExceptionFmt(ctsBracketNotFound,['[']);
|
||||
RaiseExceptionFmt(ctsBracketNotFound,['[']);
|
||||
end;
|
||||
|
||||
function CheckIdentifierAndParameterList: boolean; forward;
|
||||
|
@ -111,7 +111,7 @@ begin
|
||||
end;
|
||||
inc(i);
|
||||
end;
|
||||
SaveRaiseException(
|
||||
RaiseException(
|
||||
'[TMultiKeyWordListCodeTool.SetCurKeyWordFuncList] unknown list',true);
|
||||
end;
|
||||
|
||||
|
@ -1143,7 +1143,7 @@ begin
|
||||
end else if not (CurNode.Desc in (AllClassBaseSections+AllClassInterfaces))
|
||||
then begin
|
||||
//debugln(['TPascalParserTool.KeyWordFuncClassMethod ',CurNode.Parent.DescAsString,' ',CurNode.DescAsString]);
|
||||
RaiseIdentExpectedButAtomFound;
|
||||
SaveRaiseIdentExpectedButAtomFound;
|
||||
end;
|
||||
|
||||
HasForwardModifier:=false;
|
||||
@ -1287,7 +1287,7 @@ begin
|
||||
// MacPas '...' VarArgs parameter
|
||||
if (Scanner.CompilerMode<>cmMacPas) then begin
|
||||
if ExceptionOnError then
|
||||
RaiseIdentExpectedButAtomFound
|
||||
SaveRaiseIdentExpectedButAtomFound
|
||||
else
|
||||
exit;
|
||||
end;
|
||||
@ -2163,7 +2163,7 @@ begin
|
||||
else if CurPos.Flag=cafEdgedBracketOpen then
|
||||
Push(siEdgedBracketOpen)
|
||||
else
|
||||
RaiseBracketOpenExpectedButAtomFound;
|
||||
SaveRaiseBracketOpenExpectedButAtomFound;
|
||||
try
|
||||
repeat
|
||||
ReadNextAtom;
|
||||
@ -2327,7 +2327,7 @@ begin
|
||||
CurNode.EndPos:=CurPos.StartPos;
|
||||
EndChildNode;
|
||||
end else if not (CurNode.Desc in (AllClassBaseSections+AllClassInterfaces)) then
|
||||
RaiseIdentExpectedButAtomFound;
|
||||
SaveRaiseIdentExpectedButAtomFound;
|
||||
// create class method node
|
||||
CreateChildNode;
|
||||
CurNode.Desc:=ctnProperty;
|
||||
|
@ -258,7 +258,7 @@ begin
|
||||
Result:=false;
|
||||
if CleanPos>SrcLen then exit;
|
||||
if CleanCodePosInFront>CleanPos then
|
||||
SaveRaiseException(
|
||||
RaiseException(
|
||||
'TPascalReaderTool.CleanPosIsInComment CleanCodePosInFront>CleanPos');
|
||||
MoveCursorToCleanPos(CleanCodePosInFront);
|
||||
repeat
|
||||
@ -908,7 +908,7 @@ begin
|
||||
if (ProcNode<>nil) and (ProcNode.Desc in [ctnProcedureType,ctnProcedure]) then
|
||||
ProcNode:=ProcNode.FirstChild;
|
||||
if (ProcNode=nil) or (ProcNode.Desc<>ctnProcedureHead) then begin
|
||||
SaveRaiseException('Internal Error in'
|
||||
RaiseException('Internal Error in'
|
||||
+' TPascalParserTool.MoveCursorFirstProcSpecifier: '
|
||||
+' (ProcNode=nil) or (ProcNode.Desc<>ctnProcedure)');
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user