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