codetools: added unique ids for bug reports

git-svn-id: branches/fixes_1_8@54666 -
This commit is contained in:
mattias 2017-04-21 19:02:12 +00:00
parent d51465d0fb
commit f7a23d3529
37 changed files with 918 additions and 570 deletions

View File

@ -353,7 +353,7 @@ begin
// parse end of parameter list
if (CurPos.StartPos>SrcLen)
or (Src[CurPos.StartPos]<>CloseBracket) then
RaiseCharExpectedButAtomFound(CloseBracket);
RaiseCharExpectedButAtomFound(20170421201949,CloseBracket);
break;
end else begin
ReadPrefixModifier;
@ -397,7 +397,7 @@ begin
break;
end;
if CurPos.Flag<>cafSemicolon then
RaiseCharExpectedButAtomFound(CloseBracket);
RaiseCharExpectedButAtomFound(20170421201951,CloseBracket);
CurParam.Separator:=CurPos.StartPos;
inc(ParamIndex);
end;

View File

@ -814,7 +814,7 @@ begin
// forward proc in interface
StartSearchProc:=FindImplementationNode;
if StartSearchProc=nil then
RaiseException('Implementation section not found');
RaiseException(20170421201438,'Implementation section not found');
if StartSearchProc.FirstChild<>nil then begin
// implementation not empty
StartSearchProc:=StartSearchProc.FirstChild
@ -858,7 +858,7 @@ begin
// remove current forward proc from tree
ProcAVLNode:=FindAVLNodeWithNode(ForwardProcNodes,ProcNode);
if ProcAVLNode=nil then
RaiseException('TCodeCompletionCodeTool.FindInsertPositionForForwardProc '
RaiseException(20170421201441,'TCodeCompletionCodeTool.FindInsertPositionForForwardProc '
+' Internal Error, current forward proc not found');
ProcNodeExt:=TCodeTreeNodeExtension(ProcAVLNode.Data);
ForwardProcNodes.Delete(ProcAVLNode);
@ -984,7 +984,7 @@ begin
exit;
end;
RaiseException('TCodeCompletionCodeTool.FindInsertPositionForForwardProc '
RaiseException(20170421201444,'TCodeCompletionCodeTool.FindInsertPositionForForwardProc '
+' Internal Error: no insert position found');
end;
@ -1184,7 +1184,7 @@ begin
if CleanLevelPos<1 then CleanLevelPos:=CleanCursorPos;
//DebugLn('TCodeCompletionCodeTool.AddLocalVariable START CleanCursorPos=',CleanPosToStr(CleanCursorPos),' CleanLevelPos=',CleanPosToStr(CleanLevelPos));
if not CleanPosToCodePos(CleanCursorPos,OldCodePos) then begin
RaiseException('TCodeCompletionCodeTool.AddLocalVariable Internal Error: '
RaiseException(20170421201447,'TCodeCompletionCodeTool.AddLocalVariable Internal Error: '
+'CleanPosToCodePos');
end;
Beauty:=SourceChangeCache.BeautifyCodeOptions;
@ -1230,7 +1230,7 @@ begin
if ParentNode=nil then begin
// no target for a var
RaiseException('TCodeCompletionCodeTool.AddLocalVariable Internal Error: '
RaiseException(20170421201449,'TCodeCompletionCodeTool.AddLocalVariable Internal Error: '
+'invalid target for a var');
end;
@ -1472,11 +1472,11 @@ begin
MethodDefinition:=Beauty.AddClassAndNameToProc(MethodDefinition,
ExtractClassName(AClassNode,false,true), AnEventName);
if not InsertAllNewClassParts then
RaiseException(ctsErrorDuringInsertingNewClassParts);
RaiseException(20170421201451,ctsErrorDuringInsertingNewClassParts);
// insert all missing proc bodies
if not CreateMissingClassProcBodies(false) then
RaiseException(ctsErrorDuringCreationOfNewProcBodies);
RaiseException(20170421201453,ctsErrorDuringCreationOfNewProcBodies);
Result := True;
end;
@ -1525,7 +1525,7 @@ begin
// insert at start
if StartNode=nil then begin
// unit without implementation
RaiseException('need implementation section to insert new procedure');
RaiseException(20170421201459,'need implementation section to insert new procedure');
end;
Node:=StartNode.Next;
if Node<>nil then begin
@ -1538,7 +1538,7 @@ begin
InsertPos:=StartNode.StartPos+length('implementation');
end else begin
// empty program
RaiseException('no insert place found for the new procedure');
RaiseException(20170421201504,'no insert place found for the new procedure');
end;
end;
end;
@ -1558,7 +1558,7 @@ begin
debugln(['TCodeCompletionCodeTool.AddProcedureCompatibleToProcType NewProc="',NewProc,'"']);
if not SourceChangeCache.Replace(gtEmptyLine,gtEmptyLine,InsertPos,InsertPos,NewProc)
then
RaiseException('unable to insert code at '+CleanPosToStr(InsertPos,true));
RaiseException(20170421201508,'unable to insert code at '+CleanPosToStr(InsertPos,true));
end;
procedure TCodeCompletionCodeTool.AddNeededUnitsToMainUsesSectionForRange(
@ -1663,7 +1663,7 @@ begin
if ANode.Desc=ctnProperty then begin
// check if property is complete
if not CompleteProperty(ANode) then
RaiseException(ctsUnableToCompleteProperty);
RaiseException(20170421201511,ctsUnableToCompleteProperty);
end;
ANode:=ANode.NextBrother;
end;
@ -1749,7 +1749,7 @@ begin
if not UpdateProcBodySignatures(ProcDefNodes,ProcBodyNodes,
ProcAttrDefToBody,ProcsCopied,OnlyNode) then exit;
if not SourceChangeCache.Apply then
RaiseException('CompleteForwardProcs: unable to apply changes');
RaiseException(20170421201515,'CompleteForwardProcs: unable to apply changes');
exit;
end;
@ -1799,25 +1799,25 @@ begin
phpWithVarModifiers,phpWithParameterNames,phpWithResultType,
phpWithCallingSpecs,phpWithAssembler,phpDoNotAddSemicolon]);
if ProcCode='' then
RaiseException('CompleteForwardProcs: unable to parse forward proc node');
RaiseException(20170421201518,'CompleteForwardProcs: unable to parse forward proc node');
if ProcCode[length(ProcCode)]<>';' then begin
// add missing semicolon
ProcCode:=ProcCode+';';
UndoReadNextAtom;
if not SourceChangeCache.Replace(gtNone,gtNone,
CurPos.EndPos,CurPos.EndPos,';') then
RaiseException('CompleteForwardProcs: unable to insert semicolon');
RaiseException(20170421201522,'CompleteForwardProcs: unable to insert semicolon');
end;
ProcCode:=Beauty.BeautifyProc(ProcCode,Indent,true);
if not SourceChangeCache.Replace(gtEmptyLine,gtEmptyLine,
InsertPos,InsertPos,ProcCode) then
RaiseException('CompleteForwardProcs: unable to insert new proc body');
RaiseException(20170421201525,'CompleteForwardProcs: unable to insert new proc body');
// next
if CurProcNode=EndProcNode then break;
CurProcNode:=FindNextNodeOnSameLvl(CurProcNode);
until false;
if not SourceChangeCache.Apply then
RaiseException('CompleteForwardProcs: unable to apply changes');
RaiseException(20170421201528,'CompleteForwardProcs: unable to apply changes');
// reparse code and find jump point into new proc
Result:=FindJumpPoint(CursorPos,NewPos,NewTopLine,RevertableJump);
@ -1881,7 +1881,7 @@ begin
if Result then begin
MoveCursorToCleanPos(VarNameAtom.StartPos);
ReadNextAtom;
RaiseExceptionFmt(ctsIdentifierAlreadyDefined,[GetAtom]);
RaiseExceptionFmt(20170421201531,ctsIdentifierAlreadyDefined,[GetAtom]);
end;
{$IFDEF VerboseCompleteLocalVarAssign}
@ -1892,7 +1892,7 @@ begin
Params.ContextNode:=CursorNode;
NewType:=FindTermTypeAsString(TermAtom,Params,ExprType);
if NewType='' then
RaiseException('CompleteLocalVariableAssignment Internal error: NewType=""');
RaiseException(20170421201534,'CompleteLocalVariableAssignment Internal error: NewType=""');
// check if there is another NewType in context of CursorNode
if (ExprType.Desc = xtContext) and (ExprType.Context.Tool <> nil) then
@ -1946,10 +1946,10 @@ begin
AddClassInsertion(UpperCase(NewName)+';', NewName+':'+NewType+';',
NewName, InsertClassSectionToNewVarClassPart[CCOptions.ClassSection]);
if not InsertAllNewClassParts then
RaiseException(ctsErrorDuringInsertingNewClassParts);
RaiseException(20170421201536,ctsErrorDuringInsertingNewClassParts);
// apply the changes
if not SourceChangeCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421201538,ctsUnableToApplyChanges);
end;
end;
@ -2151,7 +2151,7 @@ function TCodeCompletionCodeTool.CompleteEventAssignment(CleanCursorPos,
// apply the changes
if not SourceChangeCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421201540,ctsUnableToApplyChanges);
{$IFDEF CTDEBUG}
DebugLn(' CompleteLocalIdentifierByParameter.AddProcedure: jumping to new method body...');
@ -2159,7 +2159,7 @@ function TCodeCompletionCodeTool.CompleteEventAssignment(CleanCursorPos,
// jump to new method body
if not JumpToMethod(AMethodDefinition,AMethodAttr,NewPos,NewTopLine)
then
RaiseException('CompleteLocalIdentifierByParameter.AddProcedure JumpToMethod failed');
RaiseException(20170421201543,'CompleteLocalIdentifierByParameter.AddProcedure JumpToMethod failed');
end;
// function CompleteEventAssignment: boolean
@ -2227,13 +2227,13 @@ begin
if not CompleteAssignment(FullEventName,AssignmentOperator,
AddrOperatorPos,SemicolonPos,UserEventAtom)
then
RaiseException('CompleteEventAssignment CompleteAssignment failed');
RaiseException(20170421201546,'CompleteEventAssignment CompleteAssignment failed');
end else if ProcContext.Tool.ProcNodeHasOfObject(ProcContext.Node) then begin
{$IFDEF VerboseCompleteEventAssign}
debugln([' CompleteEventAssignment: proc is "of object"']);
{$ENDIF}
MoveCursorToCleanPos(PropVarAtom.StartPos);
RaiseException('Complete event failed: procedure of object needs a class');
RaiseException(20170421201550,'Complete event failed: procedure of object needs a class');
end;
end else begin
// create procedure (not method)
@ -2248,7 +2248,7 @@ begin
Identifier:=GetIdentifier(@Src[PropVarAtom.StartPos]);
if Identifier='' then begin
MoveCursorToCleanPos(PropVarAtom.StartPos);
RaiseException('Complete event failed: need a name');
RaiseException(20170421201553,'Complete event failed: need a name');
end;
// create proc
{$IFDEF VerboseCompleteEventAssign}
@ -2267,7 +2267,7 @@ begin
{$ENDIF}
// apply the changes
if not SourceChangeCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421201555,ctsUnableToApplyChanges);
{$IFDEF VerboseCompleteEventAssign}
DebugLn(' CompleteEventAssignment: jumping to new method body...');
@ -2275,7 +2275,7 @@ begin
// jump to new method body
if not JumpToMethod(AMethodDefinition,AMethodAttr,NewPos,NewTopLine)
then
RaiseException('CompleteEventAssignment Internal Error 2');
RaiseException(20170421201558,'CompleteEventAssignment Internal Error 2');
Result:=true;
end;
@ -2325,7 +2325,7 @@ begin
if Result then begin
MoveCursorToCleanPos(VarNameAtom.StartPos);
ReadNextAtom;
RaiseExceptionFmt(ctsIdentifierAlreadyDefined,[GetAtom]);
RaiseExceptionFmt(20170421201601,ctsIdentifierAlreadyDefined,[GetAtom]);
end;
{$IFDEF CTDEBUG}
@ -2335,7 +2335,7 @@ begin
// find type of term
NewType:=FindForInTypeAsString(TermAtom,CursorNode,Params,ExprType);
if NewType='' then
RaiseException('CompleteLocalVariableForIn Internal error: NewType=""');
RaiseException(20170421201604,'CompleteLocalVariableForIn Internal error: NewType=""');
finally
Params.Free;
@ -2367,7 +2367,7 @@ function TCodeCompletionCodeTool.CompleteIdentifierByParameter(CleanCursorPos,
// parameter needs a method => search class of method
AClassNode:=FindClassOrInterfaceNode(CursorNode,true);
if (AClassNode=nil) then
RaiseException('parameter needs a method');
RaiseException(20170421201607,'parameter needs a method');
ProcContext:=CreateFindContext(TypeTool,TypeNode);
// create new method
@ -2378,7 +2378,7 @@ function TCodeCompletionCodeTool.CompleteIdentifierByParameter(CleanCursorPos,
// apply the changes
if not SourceChangeCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421201609,ctsUnableToApplyChanges);
{$IFDEF CTDEBUG}
DebugLn(' CompleteLocalIdentifierByParameter.AddMethod: jumping to new method body...');
@ -2386,7 +2386,7 @@ function TCodeCompletionCodeTool.CompleteIdentifierByParameter(CleanCursorPos,
// jump to new method body
if not JumpToMethod(AMethodDefinition,AMethodAttr,NewPos,NewTopLine)
then
RaiseException('CompleteLocalIdentifierByParameter.AddMethod JumpToMethod failed');
RaiseException(20170421201612,'CompleteLocalIdentifierByParameter.AddMethod JumpToMethod failed');
end;
procedure AddProcedure(Identifier: string;
@ -2404,7 +2404,7 @@ function TCodeCompletionCodeTool.CompleteIdentifierByParameter(CleanCursorPos,
// apply the changes
if not SourceChangeCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421201614,ctsUnableToApplyChanges);
{$IFDEF CTDEBUG}
DebugLn(' CompleteLocalIdentifierByParameter.AddProcedure: jumping to new method body...');
@ -2412,7 +2412,7 @@ function TCodeCompletionCodeTool.CompleteIdentifierByParameter(CleanCursorPos,
// jump to new method body
if not JumpToMethod(AMethodDefinition,AMethodAttr,NewPos,NewTopLine)
then
RaiseException('CompleteLocalIdentifierByParameter.AddProcedure JumpToMethod failed');
RaiseException(20170421201617,'CompleteLocalIdentifierByParameter.AddProcedure JumpToMethod failed');
end;
var
@ -2478,7 +2478,7 @@ begin
if Result then begin
MoveCursorToCleanPos(VarNameRange.StartPos);
ReadNextAtom;
RaiseExceptionFmt(ctsIdentifierAlreadyDefined,[GetAtom]);
RaiseExceptionFmt(20170421201619,ctsIdentifierAlreadyDefined,[GetAtom]);
end;
{$IFDEF CTDEBUG}
@ -2641,7 +2641,7 @@ begin
//DebugLn('TCodeCompletionCodeTool.CompleteLocalIdentifierByParameter NewType=',NewType);
if NewType='' then
RaiseException('CompleteLocalIdentifierByParameter Internal error: NewType=""');
RaiseException(20170421201622,'CompleteLocalIdentifierByParameter Internal error: NewType=""');
//DebugLn(' CompleteLocalIdentifierByParameter Dont know: ',Params.NewNode.DescAsString);
finally
@ -2823,7 +2823,7 @@ begin
{$ENDIF}
// store old cursor position
if not CleanPosToCodePos(CleanCursorPos,OldCodePos) then begin
RaiseException('TCodeCompletionCodeTool.CompleteMethodByBody Internal Error: '
RaiseException(20170421201627,'TCodeCompletionCodeTool.CompleteMethodByBody Internal Error: '
+'CleanPosToCodePos');
end;
@ -2850,7 +2850,7 @@ begin
// store old cursor position
if not CleanPosToCodePos(CleanCursorPos,OldCodePos) then begin
RaiseException('TCodeCompletionCodeTool.CompleteMethodByBody Internal Error: '
RaiseException(20170421201630,'TCodeCompletionCodeTool.CompleteMethodByBody Internal Error: '
+'CleanPosToCodePos');
end;
@ -3074,7 +3074,7 @@ const
DebugLn(['TCodeCompletionCodeTool.CompleteProcByCall proc already exists']);
MoveCursorToCleanPos(ProcNameAtom.StartPos);
ReadNextAtom;
RaiseExceptionFmt(ctsIdentifierAlreadyDefined,[GetAtom]);
RaiseExceptionFmt(20170421201633,ctsIdentifierAlreadyDefined,[GetAtom]);
end;
Result:=true;
end;
@ -3325,10 +3325,10 @@ begin
AddClassInsertion(UpperCaseStr(VarName),
VarName+':'+VarType+';',VarName,ncpPublishedVars);
if not InsertAllNewClassParts then
RaiseException(ctsErrorDuringInsertingNewClassParts);
RaiseException(20170421201635,ctsErrorDuringInsertingNewClassParts);
// apply the changes
if not SourceChangeCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421201637,ctsUnableToApplyChanges);
end;
Result:=true;
end;
@ -4523,8 +4523,8 @@ var
procedure AddMove(Node, InsertInFrontOf: TCodeTreeNode);
begin
if Node=InsertInFrontOf then exit;
if Node=nil then RaiseException('inconsistency');
if InsertInFrontOf=nil then RaiseException('inconsistency');
if Node=nil then RaiseException(20170421201640,'inconsistency');
if InsertInFrontOf=nil then RaiseException(20170421201643,'inconsistency');
NodeMoves.AddEdge(Node,InsertInFrontOf);
end;
@ -5125,12 +5125,12 @@ function TCodeCompletionCodeTool.FixForwardDefinitions(
ReadNextAtom;// read identifier
AtomIsIdentifierE;
ReadNextAtom;// read comma
if not AtomIsChar(',') then RaiseCharExpectedButAtomFound(',');
if not AtomIsChar(',') then RaiseCharExpectedButAtomFound(20170421201647,',');
FromPos:=CurPos.StartPos;
ReadNextAtom;// read identifier
AtomIsIdentifierE;
ReadNextAtom;//read colon
if not AtomIsChar(':') then RaiseCharExpectedButAtomFound(':');
if not AtomIsChar(':') then RaiseCharExpectedButAtomFound(20170421201651,':');
ToPos:=CurPos.StartPos;
end;
end else begin
@ -5147,7 +5147,7 @@ function TCodeCompletionCodeTool.FixForwardDefinitions(
ReadNextAtom;// read identifier
AtomIsIdentifierE;
ReadNextAtom;// read comma
if not AtomIsChar(',') then RaiseCharExpectedButAtomFound(',');
if not AtomIsChar(',') then RaiseCharExpectedButAtomFound(20170421201654,',');
ToPos:=CurPos.StartPos;
end;
end;
@ -5243,7 +5243,7 @@ function TCodeCompletionCodeTool.FixForwardDefinitions(
ReadNextAtom;
AtomIsIdentifierE;
ReadNextAtom;
if not AtomIsChar(':') then RaiseCharExpectedButAtomFound(':');
if not AtomIsChar(':') then RaiseCharExpectedButAtomFound(20170421201657,':');
FromPos:=CurPos.StartPos;
ToPos:=Node.EndPos;
NewTxt:=NewTxt+ExtractCode(FromPos,ToPos,[phpWithComments]);
@ -5437,7 +5437,7 @@ function TCodeCompletionCodeTool.GatherUnitDefinitions(out
procedure RaiseRedefinition(Node1, Node2: TCodeTreeNode);
begin
MoveCursorToNodeStart(Node1);
RaiseException('redefinition found: '+GetRedefinitionNodeText(Node1)
RaiseException(20170421201704,'redefinition found: '+GetRedefinitionNodeText(Node1)
+' at '+CleanPosToStr(Node1.StartPos)
+' and at '+CleanPosToStr(Node2.StartPos));
end;
@ -6330,7 +6330,7 @@ begin
debugln(['TCodeCompletionCodeTool.GetPossibleInitsForVariable FindIdentifierInContext Result=',Result,' VarTool=',VarTool<>nil,' VarNode=',VarNode<>nil]);
{$ENDIF}
MoveCursorToAtomPos(IdentAtom);
RaiseException('failed to resolve identifier "'+Identifier+'"');
RaiseException(20170421201708,'failed to resolve identifier "'+Identifier+'"');
end;
{$IFDEF VerboseGetPossibleInitsForVariable}
debugln(['TCodeCompletionCodeTool.GetPossibleInitsForVariable FindIdentifierInContext VarTool=',ExtractFilename(VarTool.MainFilename),' VarNode=',VarNode.DescAsString]);
@ -6438,7 +6438,7 @@ begin
end;
if Statements.Count=0 then begin
MoveCursorToAtomPos(IdentAtom);
RaiseException('auto initialize not yet implemented for identifier "'+GetIdentifier(Identifier)+'" of type "'+ExprTypeToString(ExprType)+'"');
RaiseException(20170421201711,'auto initialize not yet implemented for identifier "'+GetIdentifier(Identifier)+'" of type "'+ExprTypeToString(ExprType)+'"');
end;
// find possible insert positions
@ -6465,7 +6465,7 @@ begin
if InsertPositions.Count=0 then begin
MoveCursorToAtomPos(IdentAtom);
RaiseException('auto initialize not yet implemented for this context (Node='+CursorNode.DescAsString+')');
RaiseException(20170421201714,'auto initialize not yet implemented for this context (Node='+CursorNode.DescAsString+')');
end;
end;
@ -6719,7 +6719,7 @@ begin
AddClassInsertion(UpperCaseStr(VariableName),
VariableName+':'+NewType+';',VariableName,ClassPart);
if not InsertAllNewClassParts then
RaiseException(ctsErrorDuringInsertingNewClassParts);
RaiseException(20170421201717,ctsErrorDuringInsertingNewClassParts);
if (NewUnitName<>'')
and (not IsHiddenUsedUnit(PChar(NewUnitName)))
and (not AddUnitToMainUsesSection(NewUnitName,'',SourceChangeCache)) then
@ -6729,7 +6729,7 @@ begin
end;
// apply the changes
if not SourceChangeCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421201720,ctsUnableToApplyChanges);
exit(true);
end;
Node:=Node.Parent;
@ -6886,13 +6886,13 @@ begin
try
// insert all new class parts
if not InsertAllNewClassParts then
RaiseException(ctsErrorDuringInsertingNewClassParts);
RaiseException(20170421201722,ctsErrorDuringInsertingNewClassParts);
// insert all missing proc bodies
if AddMissingProcBodies and (not CreateMissingClassProcBodies(true)) then
RaiseException(ctsErrorDuringCreationOfNewProcBodies);
RaiseException(20170421201724,ctsErrorDuringCreationOfNewProcBodies);
// apply the changes
if not CodeCompleteSrcChgCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421201726,ctsUnableToApplyChanges);
Result:=true;
finally
FreeClassInsertionList;
@ -6955,7 +6955,7 @@ var
// or a specifier
begin
if Parts[SpecWord].StartPos>=1 then
RaiseExceptionFmt(ctsPropertySpecifierAlreadyDefined,[GetAtom]);
RaiseExceptionFmt(20170421201731,ctsPropertySpecifierAlreadyDefined,[GetAtom]);
Parts[SpecWord]:=CurPos;
ReadNextAtom;
if AtomIsChar(';') then exit;
@ -7028,7 +7028,7 @@ var
{$IFDEF CTDEBUG}
DebugLn('[TCodeCompletionCodeTool.CompleteProperty] error parsing param list');
{$ENDIF}
RaiseException(ctsErrorInParamList);
RaiseException(20170421201733,ctsErrorInParamList);
end;
CleanParamList:=GetExtraction(true);
Parts[ppParamList].EndPos:=CurPos.EndPos;
@ -7044,7 +7044,7 @@ var
or UpAtomIs('END') or AtomIsChar(';') or (not AtomIsIdentifier)
or AtomIsKeyWord then begin
// no type name found -> ignore this property
RaiseExceptionFmt(ctsPropertTypeExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421201735,ctsPropertTypeExpectedButAtomFound,[GetAtom]);
end;
end;
@ -7069,12 +7069,12 @@ var
begin
if UpAtomIs('INDEX') then begin
if Parts[ppIndexWord].StartPos>=1 then
RaiseException(ctsIndexSpecifierRedefined);
RaiseException(20170421201737,ctsIndexSpecifierRedefined);
Parts[ppIndexWord]:=CurPos;
ReadNextAtom;
if WordIsPropertySpecifier.DoItCaseInsensitive(Src,CurPos.StartPos,
CurPos.EndPos-CurPos.StartPos) then
RaiseExceptionFmt(ctsIndexParameterExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421201740,ctsIndexParameterExpectedButAtomFound,[GetAtom]);
Parts[ppIndex].StartPos:=CurPos.StartPos;
ReadConstant(true,false,[]);
Last:=LastAtoms.GetValueAt(0);
@ -7087,12 +7087,12 @@ var
begin
if UpAtomIs('DISPID') then begin
if Parts[ppDispidWord].StartPos>=1 then
RaiseException(ctsDispidSpecifierRedefined);
RaiseException(20170421201742,ctsDispidSpecifierRedefined);
Parts[ppDispidWord]:=CurPos;
ReadNextAtom;
if WordIsPropertySpecifier.DoItCaseInsensitive(Src,CurPos.StartPos,
CurPos.EndPos-CurPos.StartPos) then
RaiseExceptionFmt(ctsDispidParameterExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421201744,ctsDispidParameterExpectedButAtomFound,[GetAtom]);
Parts[ppDispid].StartPos:=CurPos.StartPos;
ReadConstant(true,false,[]);
Parts[ppDispid].EndPos:=LastAtoms.GetValueAt(0).EndPos;
@ -7118,19 +7118,19 @@ var
ReadSimpleSpec(ppStoredWord,ppStored);
end else if UpAtomIs('DEFAULT') then begin
if Parts[ppDefaultWord].StartPos>=1 then
RaiseException(ctsDefaultSpecifierRedefined);
RaiseException(20170421201746,ctsDefaultSpecifierRedefined);
Parts[ppDefaultWord]:=CurPos;
ReadNextAtom;
if WordIsPropertySpecifier.DoItCaseInsensitive(Src,CurPos.StartPos,
CurPos.EndPos-CurPos.StartPos) then
RaiseExceptionFmt(ctsDefaultParameterExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421201748,ctsDefaultParameterExpectedButAtomFound,[GetAtom]);
Parts[ppDefault].StartPos:=CurPos.StartPos;
ReadConstant(true,false,[]);
Parts[ppDefault].EndPos:=LastAtoms.GetValueAt(0).EndPos;
PartIsAtom[ppDefault]:=false;
end else if UpAtomIs('NODEFAULT') then begin
if Parts[ppNoDefaultWord].StartPos>=1 then
RaiseException(ctsNodefaultSpecifierDefinedTwice);
RaiseException(20170421201750,ctsNodefaultSpecifierDefinedTwice);
Parts[ppNoDefaultWord]:=CurPos;
ReadNextAtom;
end else if UpAtomIs('IMPLEMENTS') then begin
@ -7140,11 +7140,11 @@ var
AtomIsIdentifierE;
if WordIsPropertySpecifier.DoItCaseInsensitive(Src,CurPos.StartPos,
CurPos.EndPos-CurPos.StartPos) then
RaiseExceptionFmt(ctsIndexParameterExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421201752,ctsIndexParameterExpectedButAtomFound,[GetAtom]);
ReadNextAtom;
end;
end else
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[';',GetAtom]);
RaiseExceptionFmt(20170421201755,ctsStrExpectedButAtomFound,[';',GetAtom]);
end;
end;
@ -7274,7 +7274,7 @@ var
{$IFDEF CTDEBUG}
DebugLn('[TCodeCompletionCodeTool.CompleteProperty] Error reading param list');
{$ENDIF}
RaiseException(ctsErrorInParamList);
RaiseException(20170421201756,ctsErrorInParamList);
end;
ParamList:=GetExtraction(false);
if (Parts[ppIndexWord].StartPos<1) then begin
@ -7414,7 +7414,7 @@ var
phpWithoutBrackets,phpWithVarModifiers,
phpWithComments])
then
RaiseException(ctsErrorInParamList);
RaiseException(20170421201758,ctsErrorInParamList);
ParamList:=GetExtraction(false);
if (Parts[ppIndexWord].StartPos<1) then begin
// param list, no index
@ -8122,7 +8122,7 @@ begin
{$ENDIF}
if not FSourceChangeCache.Replace(gtNone,gtNone,
CurPos.EndPos,CurPos.EndPos,';') then
RaiseException('InsertMissingClassSemicolons: unable to insert semicolon');
RaiseException(20170421201801,'InsertMissingClassSemicolons: unable to insert semicolon');
end;
MoveCursorToFirstProcSpecifier(ANode);
if (CurPos.Flag<>cafSemicolon) and (CurPos.EndPos<ANode.FirstChild.EndPos)
@ -8135,7 +8135,7 @@ begin
{$ENDIF}
if not FSourceChangeCache.Replace(gtNone,gtNone,
CurPos.EndPos,CurPos.EndPos,';') then
RaiseException('InsertMissingClassSemicolons: unable to insert semicolon');
RaiseException(20170421201804,'InsertMissingClassSemicolons: unable to insert semicolon');
end;
end;
// next node
@ -8780,7 +8780,7 @@ var
if Caret1.Code<>Caret2.Code then
s:=s+' in '+CreateRelativePath(Caret2.Code.Filename,ExtractFilePath(Caret1.Code.Filename));
MoveCursorToNodeStart(ANode.FirstChild);
RaiseException('procedure redefined (first at '+s+')');
RaiseException(20170421201808,'procedure redefined (first at '+s+')');
end;
end;
AnAVLNode:=NextAVLNode;
@ -8820,7 +8820,7 @@ var
CodeCompleteSrcChgCache.BeautifyCodeOptions.BeautifyKeyWord('implementation'))
then begin
MoveCursorToCleanPos(InsertPos);
RaiseException('unable to insert implementation section (read only?)');
RaiseException(20170421201812,'unable to insert implementation section (read only?)');
end;
exit;
end else if (ImplementationNode.FirstChild=nil)
@ -8897,7 +8897,7 @@ var
exit;
end;
RaiseException('TCodeCompletionCodeTool.CreateMissingClassProcBodies.FindInsertPointForNewClass '
RaiseException(20170421201815,'TCodeCompletionCodeTool.CreateMissingClassProcBodies.FindInsertPointForNewClass '
+' Internal Error: no insert position found');
end;
@ -9198,21 +9198,21 @@ begin
try
// extend class declaration
if not InsertAllNewClassParts then
RaiseException(ctsErrorDuringInsertingNewClassParts);
RaiseException(20170421201817,ctsErrorDuringInsertingNewClassParts);
// create missing method bodies
if AddMissingProcBodies and (not CreateMissingClassProcBodies(true)) then
RaiseException(ctsErrorDuringCreationOfNewProcBodies);
RaiseException(20170421201819,ctsErrorDuringCreationOfNewProcBodies);
CurClassName:=ExtractClassName(CodeCompleteClassNode,false);
// apply the changes and jump to first new proc body
if not CleanPosToCodePos(CleanPos,OldCodePos) then
RaiseException('TCodeCompletionCodeTool.CompleteCode Internal Error CleanPosToCodePos');
RaiseException(20170421201822,'TCodeCompletionCodeTool.CompleteCode Internal Error CleanPosToCodePos');
if not CleanPosToCaret(CleanPos,OldCodeXYPos) then
RaiseException('TCodeCompletionCodeTool.CompleteCode Internal Error CleanPosToCaret');
RaiseException(20170421201826,'TCodeCompletionCodeTool.CompleteCode Internal Error CleanPosToCaret');
if not FSourceChangeCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421201828,ctsUnableToApplyChanges);
finally
FreeClassInsertionList;
@ -9235,11 +9235,11 @@ begin
CursorNode:=CursorNode.GetTopMostNodeOfType(ctnTypeSection);
FCodeCompleteClassNode:=FindClassNode(CursorNode,CurClassName,true,false);
if CodeCompleteClassNode=nil then
RaiseException('oops, I lost your class');
RaiseException(20170421201833,'oops, I lost your class');
ProcNode:=FindProcNode(CursorNode,FJumpToProcHead,[phpInUpperCase,phpIgnoreForwards]);
if ProcNode=nil then begin
debugln(['TCodeCompletionCodeTool.ApplyChangesAndJumpToFirstNewProc Proc="',FJumpToProcHead.Name,'"']);
RaiseException(ctsNewProcBodyNotFound);
RaiseException(20170421201835,ctsNewProcBodyNotFound);
end;
Result:=FindJumpPointInProcNode(ProcNode,NewPos,NewTopLine);
end else begin
@ -9399,7 +9399,7 @@ function TCodeCompletionCodeTool.CompleteCode(CursorPos: TCodeXYPosition;
FCompletingCursorNode:=CursorNode;
try
if not CleanPosToCodePos(OrigCleanCursorPos,OldCodePos) then
RaiseException('TCodeCompletionCodeTool.TryFirstLocalIdentOccurence CleanPosToCodePos');
RaiseException(20170421201838,'TCodeCompletionCodeTool.TryFirstLocalIdentOccurence CleanPosToCodePos');
CompleteCode:=TryCompleteLocalVar(LastCurPos.StartPos,AtomContextNode);
AdjustCursor(OldCodePos,OldTopLine,NewPos,NewTopLine);
exit(true);
@ -9449,7 +9449,7 @@ function TCodeCompletionCodeTool.CompleteCode(CursorPos: TCodeXYPosition;
if TryComplete(CursorNode, CurPos.StartPos) then
begin
if not CleanPosToCodePos(OrigCleanCursorPos,OldCodePos) then
RaiseException('TCodeCompletionCodeTool.CompleteCode CleanPosToCodePos');
RaiseException(20170421201842,'TCodeCompletionCodeTool.CompleteCode CleanPosToCodePos');
AdjustCursor(OldCodePos,OldTopLine,NewPos,NewTopLine);
exit(true);
end;
@ -9482,7 +9482,7 @@ begin
Result:=false;
if (SourceChangeCache=nil) then
RaiseException('need a SourceChangeCache');
RaiseException(20170421201857,'need a SourceChangeCache');
BuildTreeAndGetCleanPos(trTillCursor,lsrEnd,CursorPos,CleanCursorPos,
[btSetIgnoreErrorPos]);
OrigCleanCursorPos:=CleanCursorPos;
@ -9522,7 +9522,7 @@ begin
begin
// we have a codetool error, let's try to find the assignment in any case
LastCodeToolsErrorCleanPos := CurPos.StartPos;
LastCodeToolsError := ECodeToolError.Create(E.Sender, E.Message);
LastCodeToolsError := ECodeToolError.Create(E.Sender,20170421201904,E.Message);
end else
raise;
end;
@ -9559,7 +9559,7 @@ begin
NewPos:=CleanCodeXYPosition;
NewTopLine:=0;
if (SourceChangeCache=nil) then
RaiseException('need a SourceChangeCache');
RaiseException(20170421201910,'need a SourceChangeCache');
BuildTreeAndGetCleanPos(CursorPos, CleanCursorPos);
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
@ -9580,7 +9580,7 @@ begin
if Result then exit;
MoveCursorToCleanPos(CleanCursorPos);
RaiseException('this syntax is not supported by variable completion');
RaiseException(20170421201915,'this syntax is not supported by variable completion');
end;
function TCodeCompletionCodeTool.AddMethods(CursorPos: TCodeXYPosition;
@ -9615,7 +9615,7 @@ begin
exit(true);
if (SourceChangeCache=nil) then
RaiseException('need a SourceChangeCache');
RaiseException(20170421201918,'need a SourceChangeCache');
CodeCompleteSrcChgCache:=SourceChangeCache;
Beauty:=SourceChangeCache.BeautifyCodeOptions;
@ -9640,7 +9640,7 @@ begin
if (ProcNode.Desc<>ctnProcedure)
or (ProcNode.Parent=nil) then begin
NewCodeTool.MoveCursorToNodeStart(ProcNode);
RaiseException('TCodeCompletionCodeTool.AddMethods source position not a procedure');
RaiseException(20170421201921,'TCodeCompletionCodeTool.AddMethods source position not a procedure');
end;
// find visibility
VisibilityDesc:=ctnClassPublic;

View File

@ -101,6 +101,7 @@ type
FDirectivesTools: TAVLTree; // tree of TDirectivesTool sorted for Code (TCodeBuffer)
FErrorCode: TCodeBuffer;
FErrorColumn: integer;
FErrorId: int64;
FErrorLine: integer;
FErrorMsg: string;
FErrorTopLine: integer;
@ -270,7 +271,7 @@ type
// exception handling
procedure ClearError;
function HandleException(AnException: Exception): boolean;
procedure SetError(Code: TCodeBuffer; Line, Column: integer;
procedure SetError(Id: int64; Code: TCodeBuffer; Line, Column: integer;
const TheMessage: string);
property CatchExceptions: boolean
read FCatchExceptions write FCatchExceptions;
@ -280,6 +281,7 @@ type
property ErrorColumn: integer read fErrorColumn;
property ErrorLine: integer read fErrorLine;
property ErrorMessage: string read fErrorMsg;
property ErrorId: int64 read FErrorId;
property ErrorTopLine: integer read fErrorTopLine;
property ErrorDbgMsg: string read FErrorDbgMsg;
property Abortable: boolean read FAbortable write SetAbortable;
@ -1405,6 +1407,8 @@ begin
fErrorMsg:='';
fErrorCode:=nil;
fErrorLine:=-1;
fErrorTopLine:=0;
FErrorId:=0;
end;
procedure TCodeToolManager.ClearCurCodeTool;
@ -1734,6 +1738,7 @@ begin
ClearCurCodeTool;
MainCode:=GetMainCode(Code);
if MainCode=nil then begin
ClearError;
FErrorLine:=1;
FErrorColumn:=1;
fErrorCode:=Code;
@ -1764,9 +1769,7 @@ end;
function TCodeToolManager.InitResourceTool: boolean;
begin
fErrorMsg:='';
fErrorCode:=nil;
fErrorLine:=-1;
ClearError;
Result:=true;
end;
@ -1785,20 +1788,19 @@ var
ErrorDirTool: TCompilerDirectivesTree;
begin
fErrorMsg:=AnException.Message;
fErrorTopLine:=0;
fErrorCode:=nil;
fErrorColumn:=-1;
fErrorLine:=-1;
ClearError;
if (AnException is ELinkScannerError) then begin
// link scanner error
if AnException is ELinkScannerConsistency then
DumpExceptionBackTrace;
DirtyPos:=0;
if AnException is ELinkScannerEditError then begin
FErrorId:=20170421202931;
fErrorCode:=TCodeBuffer(ELinkScannerEditError(AnException).Buffer);
if fErrorCode<>nil then
DirtyPos:=ELinkScannerEditError(AnException).BufferPos;
end else begin
FErrorId:=20170421202945;
fErrorCode:=TCodeBuffer(ELinkScannerError(AnException).Sender.Code);
DirtyPos:=ELinkScannerError(AnException).Sender.SrcPos;
end;
@ -1808,6 +1810,7 @@ begin
end else if (AnException is ECodeToolError) then begin
// codetool error
ErrorSrcTool:=ECodeToolError(AnException).Sender;
FErrorId:=ECodeToolError(AnException).Id;
if ErrorSrcTool.ErrorNicePosition.Code<>nil then begin
fErrorCode:=ErrorSrcTool.ErrorNicePosition.Code;
fErrorColumn:=ErrorSrcTool.ErrorNicePosition.X;
@ -1821,10 +1824,13 @@ begin
// Compiler directive parser error
ErrorDirTool:=ECDirectiveParserException(AnException).Sender;
fErrorCode:=ErrorDirTool.Code;
FErrorId:=20170421202922;
end else if (AnException is ESourceChangeCacheError) then begin
// SourceChangeCache error
FErrorId:=20170421203005;
end else if (AnException is ECodeToolManagerError) then begin
// CodeToolManager error
FErrorId:=20170421203009;
end else begin
// unknown exception
DumpExceptionBackTrace;
@ -1833,6 +1839,7 @@ begin
fErrorCode:=FCurCodeTool.ErrorPosition.Code;
fErrorColumn:=FCurCodeTool.ErrorPosition.X;
fErrorLine:=FCurCodeTool.ErrorPosition.Y;
FErrorId:=20170421202914;
end;
end;
@ -1862,7 +1869,7 @@ end;
procedure TCodeToolManager.WriteError;
begin
if FWriteExceptions then begin
FErrorDbgMsg:='### TCodeToolManager.HandleException: "'+ErrorMessage+'"';
FErrorDbgMsg:='### TCodeToolManager.HandleException: ['+IntToStr(FErrorId)+'] "'+ErrorMessage+'"';
if ErrorLine>0 then FErrorDbgMsg+=' at Line='+DbgS(ErrorLine);
if ErrorColumn>0 then FErrorDbgMsg+=' Col='+DbgS(ErrorColumn);
if ErrorCode<>nil then FErrorDbgMsg+=' in "'+ErrorCode.Filename+'"';
@ -2713,14 +2720,14 @@ begin
DebugLn('TCodeToolManager.RenameIdentifier File ',Code.Filename,' Line=',dbgs(CurCodePos^.Y),' Col=',dbgs(CurCodePos^.X),' Identifier=',GetIdentifier(@Code.Source[IdentStartPos]));
// search absolute position in source
if IdentStartPos<1 then begin
SetError(Code, CurCodePos^.Y, CurCodePos^.X, ctsPositionNotInSource);
SetError(20170421203205,Code, CurCodePos^.Y, CurCodePos^.X, ctsPositionNotInSource);
exit;
end;
// check if old identifier is there
if CompareIdentifiers(@Code.Source[IdentStartPos],PChar(Pointer(OldIdentifier)))<>0
then begin
debugln(['TCodeToolManager.RenameIdentifier CONSISTENCY ERROR ',Dbgs(CurCodePos^),' ']);
SetError(CurCodePos^.Code,CurCodePos^.Y,CurCodePos^.X,
SetError(20170421203210,CurCodePos^.Code,CurCodePos^.Y,CurCodePos^.X,
Format(ctsStrExpectedButAtomFound,[OldIdentifier,
GetIdentifier(@Code.Source[IdentStartPos])])
);
@ -3413,6 +3420,7 @@ function TCodeToolManager.FixIncludeFilenames(Code: TCodeBuffer;
fErrorCode:=CodePos^.Code;
fErrorLine:=CodePos^.Y;
fErrorColumn:=CodePos^.X;
FErrorId:=20170421202903;
FErrorMsg:='missing include file';
end;
@ -3440,7 +3448,7 @@ begin
ToFixIncludeFiles.Delete(ToFixIncludeFiles.Count-1);
Code:=LoadFile(AFilename,false,false);
if Code=nil then begin
raise ECodeToolError.Create(FCurCodeTool,
raise ECodeToolError.Create(FCurCodeTool,20170421202139,
'unable to read file "'+AFilename+'"');
end;
// fix file
@ -5979,9 +5987,10 @@ begin
Result:=nil;
end;
procedure TCodeToolManager.SetError(Code: TCodeBuffer; Line, Column: integer;
const TheMessage: string);
procedure TCodeToolManager.SetError(Id: int64; Code: TCodeBuffer; Line,
Column: integer; const TheMessage: string);
begin
FErrorId:=Id;
FErrorMsg:=TheMessage;
FErrorCode:=Code;
FErrorLine:=Line;

View File

@ -58,6 +58,8 @@ uses
BasicCodeTools, KeywordFuncLists, FileProcs, CodeToolsStrConsts;
type
ECodeToolCfgScript = class(Exception);
TCTCSValueType = (
ctcsvNone,
ctcsvString,
@ -1315,7 +1317,7 @@ begin
Err:=TCTCfgScriptError.Create(aMsg,Position,Line,Column);
FErrors.Add(Err);
if ErrorCount>=MaxErrorCount then
raise Exception.Create(GetErrorStr(ErrorCount-1));
raise ECodeToolCfgScript.Create(GetErrorStr(ErrorCount-1));
end;
procedure TCTConfigScriptEngine.AddError(const aMsg: string);
@ -2154,7 +2156,7 @@ var
procedure ErrorInvalidOperator;
begin
raise Exception.Create('TCTConfigScriptEngine.ExecuteStack invalid operator: '+GetAtom(OperatorItem^.StartPos));
raise ECodeToolCfgScript.Create('TCTConfigScriptEngine.ExecuteStack invalid operator: '+GetAtom(OperatorItem^.StartPos));
end;
begin
@ -2522,7 +2524,7 @@ procedure TCTCfgScriptStack.Pop(Count: integer);
procedure RaiseTooManyPop;
begin
raise Exception.Create('TCTCfgScriptStack.Pop too many pop');
raise ECodeToolCfgScript.Create('TCTCfgScriptStack.Pop too many pop');
end;
var

View File

@ -55,9 +55,13 @@ ResourceString
ctsIdentExpectedButAtomFound = 'identifier expected, but %s found';
ctsIdentExpectedButKeyWordFound = 'identifier expected, but keyword %s found';
ctsStrExpectedButAtomFound = 'expected %s, but %s found';
ctsCanNotAddAUnitToTheImplementationBecauseOnlyAUnitH = 'can not add a unit '
+'to the implementation, because only a unit has one';
ctsEndOfFile = 'end of file';
ctsPositionNotInSource = 'Position not in source';
ctsInvalidClassName = 'invalid class name="%s"';
ctsInvalidPositionForInsertionOfStatements = 'invalid position for insertion'
+' of statements';
ctsclassNotFound = 'class "%s" not found';
ctsinvalidClassName2 = 'invalid class name "%s"';
ctsinvalidVariableName = 'invalid variable name "%s"';
@ -282,6 +286,8 @@ ResourceString
ctsMethodTypeDefinitionNotFound = 'method type definition not found';
ctsExpectedAMethodTypeButFound = 'expected a method type, but found %s';
ctsOldMethodNotFound = 'old method not found: %s';
ctsClassNotFound2 = 'class not found "%s"';
ctsMethodHasNoDeclaration = 'method "%s" has no declaration';
implementation

View File

@ -62,16 +62,22 @@ type
// types for errors
{ ECodeToolError }
ECodeToolError = class(Exception)
Sender: TCustomCodeTool;
constructor Create(ASender: TCustomCodeTool; const AMessage: string);
Id: int64;
constructor Create(ASender: TCustomCodeTool; TheId: int64; const AMessage: string);
end;
ECodeToolErrors = class of ECodeToolError;
{ ECodeToolFileNotFound }
ECodeToolFileNotFound = class(ECodeToolError)
Filename: string;
constructor Create(ASender: TCustomCodeTool;
constructor Create(ASender: TCustomCodeTool; TheId: int64;
const AMessage, AFilename: string);
end;
@ -119,10 +125,10 @@ type
procedure SetScanner(NewScanner: TLinkScanner); virtual;
procedure DoDeleteNodes(StartNode: TCodeTreeNode); virtual;
procedure CloseUnfinishedNodes;
procedure SaveRaiseIdentExpectedButAtomFound;
procedure SaveRaiseBracketOpenExpectedButAtomFound;
procedure SaveRaiseBracketCloseExpectedButAtomFound;
procedure RaiseUndoImpossible;
procedure SaveRaiseIdentExpectedButAtomFound(id: int64);
procedure SaveRaiseBracketOpenExpectedButAtomFound(id: int64);
procedure SaveRaiseBracketCloseExpectedButAtomFound(id: int64);
procedure RaiseUndoImpossible(id: int64);
procedure SetIgnoreErrorAfter(const AValue: TCodePosition); virtual;
procedure IncreaseTreeChangeStep(NodesDeleting: boolean);
protected
@ -132,6 +138,7 @@ type
LastErrorBehindIgnorePosition: boolean;
LastErrorCheckedForIgnored: boolean;
LastErrorNicePosition: TCodeXYPosition;
LastErrorId: int64;
procedure ClearLastError;
procedure RaiseLastError;
procedure DoProgress; inline;
@ -284,18 +291,18 @@ type
// error handling
procedure RaiseExceptionInstance(TheException: ECodeToolError;
ClearNicePos: boolean = true); virtual;
procedure RaiseExceptionClass(const AMessage: string;
procedure RaiseExceptionClass(id: int64; const AMessage: string;
ExceptionClass: ECodeToolErrors; ClearNicePos: boolean); virtual;
procedure RaiseException(const AMessage: string;
procedure RaiseException(id: int64; const AMessage: string;
ClearNicePos: boolean = true); virtual;
procedure RaiseExceptionFmt(const AMessage: string;
procedure RaiseExceptionFmt(id: int64; const AMessage: string;
const args: array of const; ClearNicePos: boolean = true);
procedure RaiseExceptionAtErrorPos(const AMessage: string;
procedure RaiseExceptionAtErrorPos(id: int64; const AMessage: string;
ClearNicePos: boolean = true); virtual;
// permanent errors, that the parser will raise again
procedure SaveRaiseException(const AMessage: string;
procedure SaveRaiseException(id: int64; const AMessage: string;
ClearNicePos: boolean = true); virtual;
procedure SaveRaiseExceptionFmt(const AMessage: string;
procedure SaveRaiseExceptionFmt(id: int64; const AMessage: string;
const args: array of const; ClearNicePos: boolean = true);
procedure SetNiceErrorPos(CleanPos: integer);
property IgnoreErrorAfter: TCodePosition
@ -386,31 +393,31 @@ begin
ClearLastError;
end;
procedure TCustomCodeTool.RaiseException(const AMessage: string;
procedure TCustomCodeTool.RaiseException(id: int64; const AMessage: string;
ClearNicePos: boolean);
begin
RaiseExceptionClass(AMessage,ECodeToolError,ClearNicePos);
RaiseExceptionClass(id,AMessage,ECodeToolError,ClearNicePos);
end;
procedure TCustomCodeTool.RaiseExceptionFmt(const AMessage: string;
procedure TCustomCodeTool.RaiseExceptionFmt(id: int64; const AMessage: string;
const args: array of const; ClearNicePos: boolean);
begin
RaiseException(Format(AMessage,args),ClearNicePos);
RaiseException(id,Format(AMessage,args),ClearNicePos);
end;
procedure TCustomCodeTool.RaiseExceptionAtErrorPos(const AMessage: string;
ClearNicePos: boolean);
procedure TCustomCodeTool.RaiseExceptionAtErrorPos(id: int64;
const AMessage: string; ClearNicePos: boolean);
begin
if ClearNicePos then
ErrorNicePosition:=CleanCodeXYPosition;
// raise the exception
if not RaiseUnhandableExceptions then
raise ECodeToolError.Create(Self,AMessage)
raise ECodeToolError.Create(Self,id,AMessage)
else
RaiseCatchableException(AMessage);
RaiseCatchableException('['+IntToStr(id)+'] '+AMessage);
end;
procedure TCustomCodeTool.SaveRaiseException(const AMessage: string;
procedure TCustomCodeTool.SaveRaiseException(id: int64; const AMessage: string;
ClearNicePos: boolean);
var
Node: TCodeTreeNode;
@ -418,6 +425,7 @@ begin
LastErrorMessage:=AMessage;
LastErrorCurPos:=CurPos;
LastErrorValid:=true;
LastErrorId:=id;
if ClearNicePos then begin
LastErrorNicePosition.Code:=nil;
LastErrorNicePosition.Y:=-1;
@ -435,13 +443,13 @@ begin
Node:=Node.Parent;
end;
RaiseException(AMessage,ClearNicePos);
RaiseException(id,AMessage,ClearNicePos);
end;
procedure TCustomCodeTool.SaveRaiseExceptionFmt(const AMessage: string;
const args: array of const; ClearNicePos: boolean);
procedure TCustomCodeTool.SaveRaiseExceptionFmt(id: int64;
const AMessage: string; const args: array of const; ClearNicePos: boolean);
begin
SaveRaiseException(Format(AMessage,args),ClearNicePos);
SaveRaiseException(id,Format(AMessage,args),ClearNicePos);
end;
procedure TCustomCodeTool.SetNiceErrorPos(CleanPos: integer);
@ -475,7 +483,7 @@ begin
MoveCursorToCleanPos(LastErrorCurPos.StartPos);
CurPos:=LastErrorCurPos;
ErrorNicePosition:=LastErrorNicePosition;
SaveRaiseException(LastErrorMessage,false);
SaveRaiseException(LastErrorId,LastErrorMessage,false);
end;
procedure TCustomCodeTool.DoProgress;
@ -492,7 +500,7 @@ begin
if Assigned(OnParserProgress) then begin
if OnParserProgress(Self) then exit;
// raise the abort exception to stop the parsing
RaiseExceptionClass('Abort',EParserAbort,true);
RaiseExceptionClass(20170421194502,'Abort',EParserAbort,true);
end;
end;
@ -535,9 +543,9 @@ begin
Result:=false;
end;
procedure TCustomCodeTool.RaiseUndoImpossible;
procedure TCustomCodeTool.RaiseUndoImpossible(id: int64);
begin
RaiseException('TCustomCodeTool.UndoReadNextAtom impossible',true);
RaiseException(id,'TCustomCodeTool.UndoReadNextAtom impossible',true);
end;
procedure TCustomCodeTool.SetScanner(NewScanner: TLinkScanner);
@ -760,12 +768,12 @@ procedure TCustomCodeTool.AtomIsIdentifierE;
procedure RaiseEOFFound;
begin
RaiseExceptionFmt(ctsIdentExpectedButEOFFound,[GetAtom],true);
RaiseExceptionFmt(20170421194604,ctsIdentExpectedButEOFFound,[GetAtom],true);
end;
procedure RaiseAtomFound;
begin
RaiseExceptionFmt(ctsIdentExpectedButAtomFound,[GetAtom],true);
RaiseExceptionFmt(20170421194607,ctsIdentExpectedButAtomFound,[GetAtom],true);
end;
begin
@ -789,7 +797,7 @@ procedure TCustomCodeTool.AtomIsIdentifierSaveE;
procedure SaveRaiseIdentExpectedButEOFFound;
begin
SaveRaiseExceptionFmt(ctsIdentExpectedButEOFFound,[GetAtom]);
SaveRaiseExceptionFmt(20170421194611,ctsIdentExpectedButEOFFound,[GetAtom]);
end;
begin
@ -797,7 +805,7 @@ begin
if CurPos.StartPos>SrcLen then
SaveRaiseIdentExpectedButEOFFound
else
SaveRaiseIdentExpectedButAtomFound;
SaveRaiseIdentExpectedButAtomFound(20170421194618);
end;
function TCustomCodeTool.AtomIsCustomOperator(AllowIdentifier,
@ -807,14 +815,14 @@ function TCustomCodeTool.AtomIsCustomOperator(AllowIdentifier,
begin
if CurPos.StartPos>SrcLen then begin
if SaveE then
SaveRaiseException(ctsOperatorExpectedButEOFFound)
SaveRaiseException(20170421194635,ctsOperatorExpectedButEOFFound)
else
RaiseException(ctsOperatorExpectedButEOFFound)
RaiseException(20170421194649,ctsOperatorExpectedButEOFFound)
end else begin
if SaveE then
SaveRaiseExceptionFmt(ctsOperatorExpectedButAtomFound,[GetAtom])
SaveRaiseExceptionFmt(20170421194701,ctsOperatorExpectedButAtomFound,[GetAtom])
else
RaiseExceptionFmt(ctsOperatorExpectedButAtomFound,[GetAtom])
RaiseExceptionFmt(20170421194704,ctsOperatorExpectedButAtomFound,[GetAtom])
end;
end;
@ -1883,7 +1891,7 @@ begin
CurPos:=LastAtoms.GetValueAt(0);
LastAtoms.UndoLastAdd;
end else
RaiseUndoImpossible;
RaiseUndoImpossible(20170421194733);
end;
function TCustomCodeTool.ReadTilBracketClose(
@ -1896,9 +1904,9 @@ var CloseBracket, AntiCloseBracket: TCommonAtomFlag;
procedure RaiseBracketNotFound;
begin
if CloseBracket=cafRoundBracketClose then
SaveRaiseExceptionFmt(ctsBracketNotFound,[')'],false)
SaveRaiseExceptionFmt(20170421194736,ctsBracketNotFound,[')'],false)
else
SaveRaiseExceptionFmt(ctsBracketNotFound,[']'],false);
SaveRaiseExceptionFmt(20170421194740,ctsBracketNotFound,[']'],false);
end;
begin
@ -1911,7 +1919,7 @@ begin
AntiCloseBracket:=cafRoundBracketClose;
end else begin
if ExceptionOnNotFound then
SaveRaiseBracketOpenExpectedButAtomFound;
SaveRaiseBracketOpenExpectedButAtomFound(20170421194744);
exit;
end;
Start:=CurPos;
@ -1943,9 +1951,9 @@ var OpenBracket, AntiOpenBracket: TCommonAtomFlag;
procedure RaiseBracketNotFound;
begin
if OpenBracket=cafRoundBracketOpen then
SaveRaiseExceptionFmt(ctsBracketNotFound,['('])
SaveRaiseExceptionFmt(20170421194747,ctsBracketNotFound,['('])
else
SaveRaiseExceptionFmt(ctsBracketNotFound,['[']);
SaveRaiseExceptionFmt(20170421194749,ctsBracketNotFound,['[']);
end;
begin
@ -1958,7 +1966,7 @@ begin
AntiOpenBracket:=cafRoundBracketOpen;
end else begin
if ExceptionOnNotFound then
SaveRaiseBracketCloseExpectedButAtomFound;
SaveRaiseBracketCloseExpectedButAtomFound(20170421194752);
exit;
end;
Start:=CurPos;
@ -2012,7 +2020,7 @@ begin
Dummy:=CaretToCleanPos(CursorPos, CleanCursorPos);
if (Dummy<>0) and (Dummy<>-1) then begin
MoveCursorToCleanPos(1);
RaiseException(ctsCursorPosOutsideOfCode,true);
RaiseException(20170421194754,ctsCursorPosOutsideOfCode,true);
end;
end;
@ -2156,7 +2164,7 @@ begin
//debugln(['TCustomCodeTool.RaiseNodeParserError ',Node.DescAsString,' Msg="',NodeError.Msg,'" ',CleanPosToStr(NodeError.CleanPos)]);
MoveCursorToCleanPos(NodeError.CleanPos);
ErrorNicePosition:=NodeError.NicePos;
RaiseException(NodeError.Msg,false);
RaiseException(20170421194759,NodeError.Msg,false);
end;
procedure TCustomCodeTool.RaiseCursorOutsideCode(CursorPos: TCodeXYPosition);
@ -2238,7 +2246,7 @@ begin
end;
end;
end;
RaiseExceptionAtErrorPos(Msg);
RaiseExceptionAtErrorPos(20170421194801,Msg);
end;
function TCustomCodeTool.StringIsKeyWord(const Word: string): boolean;
@ -2268,12 +2276,12 @@ procedure TCustomCodeTool.MoveCursorToCleanPos(ACleanPos: PChar);
procedure RaiseSrcEmpty;
begin
RaiseException('[TCustomCodeTool.MoveCursorToCleanPos - PChar] Src empty',true);
RaiseException(20170421194805,'[TCustomCodeTool.MoveCursorToCleanPos - PChar] Src empty',true);
end;
procedure RaiseNotInSrc;
begin
RaiseException('[TCustomCodeTool.MoveCursorToCleanPos - PChar] '
RaiseException(20170421194809,'[TCustomCodeTool.MoveCursorToCleanPos - PChar] '
+'CleanPos not in Src',true);
end;
@ -2300,7 +2308,7 @@ var
begin
ANode:=FindDeepestNodeAtPos(ACleanPos,true);
if ANode=nil then
RaiseException('TCustomCodeTool.MoveCursorToNearestAtom internal error',true);
RaiseException(20170421194812,'TCustomCodeTool.MoveCursorToNearestAtom internal error',true);
MoveCursorToNodeStart(ANode);
BestPos:=CurPos.StartPos;
while (CurPos.StartPos<=ACleanPos) and (CurPos.StartPos<=SrcLen) do begin
@ -2435,10 +2443,11 @@ begin
end;
end;
procedure TCustomCodeTool.RaiseExceptionClass(const AMessage: string;
ExceptionClass: ECodeToolErrors; ClearNicePos: boolean);
procedure TCustomCodeTool.RaiseExceptionClass(id: int64;
const AMessage: string; ExceptionClass: ECodeToolErrors; ClearNicePos: boolean
);
begin
RaiseExceptionInstance(ExceptionClass.Create(Self,AMessage),ClearNicePos);
RaiseExceptionInstance(ExceptionClass.Create(Self,id,AMessage),ClearNicePos);
end;
function TCustomCodeTool.DefaultKeyWordFunc: boolean;
@ -2552,7 +2561,7 @@ function TCustomCodeTool.FindDeepestNodeAtPos(StartNode: TCodeTreeNode;
if (Tree=nil) or (Tree.Root=nil) then begin
debugln(['TCustomCodeTool.FindDeepestNodeAtPos there are no nodes, maybe you forgot to parse?']);
CTDumpStack;
RaiseException('no pascal code or not yet parsed');
RaiseException(20170421194833,'no pascal code or not yet parsed');
end;
if p<Tree.Root.StartPos then begin
// in front of parsed code
@ -2564,7 +2573,7 @@ function TCustomCodeTool.FindDeepestNodeAtPos(StartNode: TCodeTreeNode;
+CleanPosToStr(Tree.Root.StartPos)+')';
end;
MoveCursorToCleanPos(P);
RaiseException(Msg);
RaiseException(20170421194836,Msg);
end;
// behind parsed code
Node:=Tree.Root;
@ -2575,16 +2584,16 @@ function TCustomCodeTool.FindDeepestNodeAtPos(StartNode: TCodeTreeNode;
LastPos:=Node.StartPos;
if p>LastPos then begin
Msg:='Behind code (last token at '+CleanPosToStr(LastPos)+')';
RaiseException(Msg);
RaiseException(20170421194838,Msg);
end;
// p is in parsed code, the StartNode is wrong
CTDumpStack;
if (StartNode<>nil) then
RaiseException('Invalid search. The search for pascal started at '
RaiseException(20170421194842,'Invalid search. The search for pascal started at '
+CleanPosToStr(StartNode.StartPos)+'. Invalid search')
else
RaiseException('Inconsistency error in TCustomCodeTool.FindDeepestNodeAtPos');
RaiseException(20170421194846,'Inconsistency error in TCustomCodeTool.FindDeepestNodeAtPos');
end;
var
@ -2808,7 +2817,7 @@ begin
//debugln(['TCustomCodeTool.GetCleanPosInfo D "',dbgstr(Src,SameArea.StartPos,SameArea.EndPos-SameArea.StartPos),'"']);
if (SameArea.StartPos=SameArea.EndPos) then
// inconsistency: some non space and non comment between two tokens
RaiseException('TCustomCodeTool.GetCleanPosInfo Internal Error A');
RaiseException(20170421194850,'TCustomCodeTool.GetCleanPosInfo Internal Error A');
if CleanPos<SameArea.EndPos then begin
// cursor is in comment
if ResolveComments then begin
@ -2823,7 +2832,8 @@ begin
end;
'(','/': inc(CodePosInFront,2);
else
RaiseException('TCustomCodeTool.GetCleanPosInfo Internal Error B '+dbgstr(Src[CodePosInFront])+' at '+CleanPosToStr(CodePosInFront,true));
RaiseException(20170421194855,'TCustomCodeTool.GetCleanPosInfo Internal Error B '
+dbgstr(Src[CodePosInFront])+' at '+CleanPosToStr(CodePosInFront,true));
end;
if CodePosInFront>CleanPos then
// CleanPos at start of comment => return comment
@ -3092,22 +3102,22 @@ begin
end;
end;
procedure TCustomCodeTool.SaveRaiseIdentExpectedButAtomFound;
procedure TCustomCodeTool.SaveRaiseIdentExpectedButAtomFound(id: int64);
begin
SaveRaiseExceptionFmt(ctsIdentExpectedButAtomFound,[GetAtom]);
SaveRaiseExceptionFmt(id,ctsIdentExpectedButAtomFound,[GetAtom]);
end;
procedure TCustomCodeTool.SaveRaiseBracketOpenExpectedButAtomFound;
procedure TCustomCodeTool.SaveRaiseBracketOpenExpectedButAtomFound(id: int64);
begin
SaveRaiseExceptionFmt(ctsBracketOpenExpectedButAtomFound,[GetAtom]);
SaveRaiseExceptionFmt(id,ctsBracketOpenExpectedButAtomFound,[GetAtom]);
end;
procedure TCustomCodeTool.SaveRaiseBracketCloseExpectedButAtomFound;
procedure TCustomCodeTool.SaveRaiseBracketCloseExpectedButAtomFound(id: int64);
begin
if CurPos.StartPos<SrcLen then
SaveRaiseExceptionFmt(ctsBracketCloseExpectedButAtomFound,[GetAtom])
SaveRaiseExceptionFmt(id,ctsBracketCloseExpectedButAtomFound,[GetAtom])
else
SaveRaiseExceptionFmt(ctsBracketNotFound,[])
SaveRaiseExceptionFmt(id,ctsBracketNotFound,[])
end;
procedure TCustomCodeTool.ActivateGlobalWriteLock;
@ -3130,19 +3140,20 @@ end;
{ ECodeToolError }
constructor ECodeToolError.Create(ASender: TCustomCodeTool;
constructor ECodeToolError.Create(ASender: TCustomCodeTool; TheId: int64;
const AMessage: string);
begin
inherited Create(AMessage);
Sender:=ASender;
Id:=TheId;
end;
{ ECodeToolFileNotFound }
constructor ECodeToolFileNotFound.Create(ASender: TCustomCodeTool;
const AMessage, AFilename: string);
TheId: int64; const AMessage, AFilename: string);
begin
inherited Create(ASender,AMessage);
inherited Create(ASender,TheId,AMessage);
Filename:=AFilename;
end;

View File

@ -528,7 +528,7 @@ var
procedure RaiseTypeNotFound;
begin
RaiseException('type '+ATypeInfo^.Name+' not found, because tool is '+dbgsname(Tool));
RaiseException(20170421201954,'type '+ATypeInfo^.Name+' not found, because tool is '+dbgsname(Tool));
end;
var
@ -558,7 +558,7 @@ begin
ContextNode:=FindMainBeginEndNode;
if ContextNode=nil then begin
MoveCursorToNodeStart(Tree.Root);
RaiseException(Format(ctsIdentifierNotFound,[GetIdentifier(@TypeName[1])]));
RaiseExceptionFmt(20170421202000,ctsIdentifierNotFound,[GetIdentifier(@TypeName[1])]);
end;
Params:=TFindDeclarationParams.Create(Self,ContextNode);
try
@ -569,7 +569,7 @@ begin
// find proc node
if Params.NewNode.Desc<>ctnTypeDefinition then begin
Params.NewCodeTool.MoveCursorToNodeStart(Params.NewNode);
Params.NewCodeTool.RaiseException(ctsMethodTypeDefinitionNotFound);
Params.NewCodeTool.RaiseException(20170421202006,ctsMethodTypeDefinitionNotFound);
end;
TypeContext:=CreateFindContext(Params);
finally
@ -581,12 +581,12 @@ begin
Result:=TypeContext.Tool.FindBaseTypeOfNode(Params,TypeContext.Node);
if Result.Node=nil then begin
TypeContext.Tool.MoveCursorToNodeStart(TypeContext.Node);
TypeContext.Tool.RaiseException(ctsMethodTypeDefinitionNotFound);
TypeContext.Tool.RaiseException(20170421202013,ctsMethodTypeDefinitionNotFound);
end;
if not (Result.Node.Desc in AllProcTypes) then begin
TypeContext.Tool.MoveCursorToNodeStart(TypeContext.Node);
TypeContext.Tool.RaiseException(Format(ctsExpectedAMethodTypeButFound, [
Result.Node.DescAsString]));
TypeContext.Tool.RaiseExceptionFmt(20170421202019,ctsExpectedAMethodTypeButFound, [
Result.Node.DescAsString]);
end;
finally
Params.Free;
@ -718,17 +718,18 @@ begin
SrcTool:=TEventsCodeTool(AFindContext.Tool);
ClassNode:=AFindContext.Node.Parent.Parent;
if not (ClassNode.Desc in [ctnClass,ctnObjCClass]) then begin
if ErrorOnNotFound then
RaiseExceptionFmt('method "%s" not found in class "%s" (%s) in %s', [AClassName,AMethodName,ClassNode.DescAsString,SrcTool.MainFilename]);
DebugLn(['TEventsCodeTool.JumpToPublishedMethodBody method found in non class: ',AClassName,'.',AMethodName,' in ',SrcTool.MainFilename,' Node=',ClassNode.DescAsString]);
if ErrorOnNotFound then
RaiseExceptionFmt(20170421202025,'method "%s" not found in class "%s" (%s) in %s',
[AClassName,AMethodName,ClassNode.DescAsString,SrcTool.MainFilename]);
exit;
end;
SrcClassName:=SrcTool.ExtractClassName(ClassNode,true);
ANode:=SrcTool.FindMethodNodeInImplementation(SrcClassName,AMethodName,false);
if ANode=nil then begin
if ErrorOnNotFound then
RaiseExceptionFmt('implementation of method "%s.%s" in %s', [AClassName,AMethodName,SrcTool.MainFilename]);
DebugLn(['TEventsCodeTool.JumpToPublishedMethodBody method not found ',SrcClassName,'.',AMethodName,' in ',SrcTool.MainFilename]);
if ErrorOnNotFound then
RaiseExceptionFmt(20170421202044,'implementation of method "%s.%s" in %s', [AClassName,AMethodName,SrcTool.MainFilename]);
exit;
end;
Result:=SrcTool.FindJumpPointInProcNode(ANode,NewPos,NewTopLine);
@ -759,28 +760,28 @@ var ProcNode, ProcHeadNode: TCodeTreeNode;
begin
Result:=false;
if (ClassNode=nil) or not (ClassNode.Desc in [ctnClass,ctnObjCClass]) then
RaiseException('Invalid class node');
RaiseException(20170421202048,'Invalid class node');
if (AOldMethodName='') then
RaiseException('Invalid AOldMethodName="'+AOldMethodName+'"');
RaiseException(20170421202051,'Invalid AOldMethodName="'+AOldMethodName+'"');
if (NewMethodName='') then
RaiseException('Invalid NewMethodName="'+NewMethodName+'"');
RaiseException(20170421202054,'Invalid NewMethodName="'+NewMethodName+'"');
if (SourceChangeCache=nil) or (Scanner=nil) then
RaiseException('Invalid SourceChangeCache or Scanner');
RaiseException(20170421202056,'Invalid SourceChangeCache or Scanner');
SourceChangeCache.MainScanner:=Scanner;
// rename in class
ProcNode:=FindIdentifierNodeInClass(ClassNode,@AOldMethodName[1]);
if (ProcNode=nil) then begin
MoveCursorToNodeStart(ClassNode);
RaiseExceptionFmt(ctsOldMethodNotFound,[AOldMethodName]);
RaiseExceptionFmt(20170421202101,ctsOldMethodNotFound,[AOldMethodName]);
end;
if (ProcNode.Desc<>ctnProcedure) then begin
MoveCursorToNodeStart(ProcNode);
RaiseExceptionFmt(ctsOldMethodNotFound,[AOldMethodName]);
RaiseExceptionFmt(20170421202103,ctsOldMethodNotFound,[AOldMethodName]);
end;
ProcHeadNode:=ProcNode.FirstChild;
if ProcHeadNode=nil then begin
MoveCursorToNodeStart(ProcNode);
RaiseException('Invalid proc header');
RaiseException(20170421202106,'Invalid proc header');
end;
NameStart:=ProcHeadNode.StartPos;
NameEnd:=NameStart;
@ -790,7 +791,7 @@ begin
NewMethodName)
then begin
MoveCursorToNodeStart(ProcHeadNode);
RaiseException('Unable to rename method declaration');
RaiseException(20170421202109,'Unable to rename method declaration');
end;
// main goal achieved
Result:=true;
@ -896,7 +897,7 @@ function TEventsCodeTool.CreateMethod(ClassNode: TCodeTreeNode;
exit;
end;
if FindContext.Node.Desc<>ctnProperty then
FindContext.Tool.RaiseException(
FindContext.Tool.RaiseException(20170421202114,
APropertyPath+' is not a property.'
+' See '+FindContext.Tool.MainFilename
+' '+FindContext.Tool.CleanPosToStr(FindContext.Node.StartPos));
@ -1008,15 +1009,15 @@ begin
DebugLn('[TEventsCodeTool.CreateMethod] invoke class completion');
{$ENDIF}
if not InsertAllNewClassParts then
RaiseException(ctsErrorDuringInsertingNewClassParts);
RaiseException(20170421202116,ctsErrorDuringInsertingNewClassParts);
if not CreateMissingClassProcBodies(false) then
RaiseException(ctsErrorDuringCreationOfNewProcBodies);
RaiseException(20170421202118,ctsErrorDuringCreationOfNewProcBodies);
if not InsertAllNewUnitsToMainUsesSection then
RaiseException(ctsErrorDuringInsertingNewUsesSection);
RaiseException(20170421202120,ctsErrorDuringInsertingNewUsesSection);
// apply the changes
if not SourceChangeCache.Apply then
RaiseException(ctsUnableToApplyChanges);
RaiseException(20170421202122,ctsUnableToApplyChanges);
{$IFDEF CTDEBUG}
DebugLn('[TEventsCodeTool.CreateMethod] END');
{$ENDIF}
@ -1033,7 +1034,7 @@ var
procedure RaiseClassNotFound;
begin
RaiseExceptionFmt(ctsClassSNotFound, [AClassName]);
RaiseExceptionFmt(20170421202124,ctsClassSNotFound, [AClassName]);
end;
var
@ -1137,14 +1138,14 @@ begin
if ExceptionOnNotFound then Include(Params.Flags,fdfExceptionOnNotFound);
Params.SetIdentifier(Self,PChar(PropName),nil);
if not AClassContext.Tool.FindIdentifierInContext(Params) then begin
RaiseException('property not found '+DbgSName(Instance)+'.'+PropName);
RaiseException(20170421202129,'property not found '+DbgSName(Instance)+'.'+PropName);
exit;
end;
if Params.NewNode=nil then exit;
PropNode:=Params.NewNode;
if PropNode.Desc<>ctnProperty then begin
debugln(['TEventsCodeTool.FindTypeOfPropertyInfo identifier ',DbgSName(Instance)+'.'+PropName,' is not property, found ',PropNode.DescAsString]);
RaiseException('identifier is not a property: '+DbgSName(Instance)+'.'+PropName);
RaiseException(20170421202135,'identifier is not a property: '+DbgSName(Instance)+'.'+PropName);
end;
// search base type of property
TypeContext:=Params.NewCodeTool.FindBaseTypeOfNode(Params,PropNode);

View File

@ -857,7 +857,7 @@ var
ShortProcFormat+[phpIgnoreForwards]);
Result:=ConflictProcNode<>nil;
if Result then begin
RaiseException('New procedure "'+ProcName+'" exists already');
RaiseException(20170421201925,'New procedure "'+ProcName+'" exists already');
end;
{$IFDEF CTDebug}
DebugLn('NewProcAlreadExists END ProcHead="',ProcHead,'" Found=',dbgs(Result));
@ -926,7 +926,7 @@ var
AddClassInsertion(CleanMethodDefinition, MethodDefinition,
ProcName, NewClassPart, nil, ProcCode);
if not InsertAllNewClassParts then
RaiseException(ctsErrorDuringInsertingNewClassParts);
RaiseException(20170421201927,ctsErrorDuringInsertingNewClassParts);
end;
end;
@ -963,7 +963,7 @@ var
eptPublicMethod] then
begin
if not CreateMissingClassProcBodies(false) then
RaiseException(ctsErrorDuringCreationOfNewProcBodies);
RaiseException(20170421201930,ctsErrorDuringCreationOfNewProcBodies);
end else begin
TabWidth:=Beauty.TabWidth;
IndentText(ProcCode,Indent,TabWidth,IndentedProcCode);
@ -1161,7 +1161,7 @@ var
in (AllClasses+[ctnEnumerationType])))
then begin
MoveCursorToCleanPos(Cache^.WithVarNode.StartPos);
RaiseException(ctsExprTypeMustBeClassOrRecord);
RaiseException(20170421201932,ctsExprTypeMustBeClassOrRecord);
end;
{$IFDEF CTDEBUG}
debugln(['IdentifierDefinedByWith WithVarExpr=',ExprTypeToString(Cache^.WithVarExpr)]);
@ -1587,16 +1587,16 @@ var
if (StartFlag=cafRoundBracketOpen) then
break
else if StartFlag=cafEdgedBracketOpen then
RaiseCharExpectedButAtomFound(']')
RaiseCharExpectedButAtomFound(20170421201936,']')
else
RaiseStringExpectedButAtomFound('end');
RaiseStringExpectedButAtomFound(20170421201938,'end');
cafEdgedBracketClose:
if (StartFlag=cafEdgedBracketOpen) then
break
else if StartFlag=cafRoundBracketOpen then
RaiseCharExpectedButAtomFound(')')
RaiseCharExpectedButAtomFound(20170421201942,')')
else
RaiseStringExpectedButAtomFound('end');
RaiseStringExpectedButAtomFound(20170421201946,'end');
end;
if AtomIsIdentifier then begin
LastPos:=LastAtoms.GetValueAt(0);

View File

@ -759,8 +759,8 @@ type
Params: TFindDeclarationParams): boolean;
protected
WordIsPredefinedIdentifier: TKeyWordFunctionList;
procedure RaiseUsesExpected;
procedure RaiseStrConstExpected;
procedure RaiseUsesExpected(id: int64);
procedure RaiseStrConstExpected(id: int64);
protected
// node caches
procedure DoDeleteNodes(StartNode: TCodeTreeNode); override;
@ -2432,7 +2432,7 @@ begin
Params.IdentifierTool.MoveCursorToCleanPos(Params.Identifier)
else
MoveCursorToCleanPos(CleanCursorPos);
Params.IdentifierTool.RaiseExceptionFmt(ctsIdentifierNotFound,
Params.IdentifierTool.RaiseExceptionFmt(20170421200024,ctsIdentifierNotFound,
[GetIdentifier(Params.Identifier)]);
end;
end;
@ -2909,7 +2909,7 @@ begin
if (UsesNode.Desc=ctnUsesSection) then begin
ReadNextAtom;
if not UpAtomIs('USES') then
RaiseUsesExpected;
RaiseUsesExpected(20170421200506);
end else
if (UsesNode.Desc = ctnUseUnitClearName) then
MoveCursorToNodeStart(UsesNode.Parent);
@ -2933,7 +2933,7 @@ begin
end;
if CurPos.Flag=cafSemicolon then break;
if CurPos.Flag<>cafComma then
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[';',GetAtom])
RaiseExceptionFmt(20170421200032,ctsStrExpectedButAtomFound,[';',GetAtom])
until (CurPos.StartPos>SrcLen);
{$IFDEF ShowTriedContexts}
DebugLn('TFindDeclarationTool.FindDeclarationInUsesSection END cursor not on AUnitName');
@ -3018,7 +3018,7 @@ begin
or (not (TObject(Scanner.MainCode) is TCodeBuffer))
or (Scanner.OnLoadSource=nil)
then begin
RaiseException('TFindDeclarationTool.FindUnitSource Invalid Data');
RaiseException(20170421200035,'TFindDeclarationTool.FindUnitSource Invalid Data');
end;
NewUnitName:=AnUnitName;
@ -3056,13 +3056,13 @@ begin
if CompiledFilename<>'' then begin
// there is a compiled unit, only the source was not found
RaiseExceptionInstance(
ECodeToolUnitNotFound.Create(Self,
ECodeToolUnitNotFound.Create(Self,20170421200052,
Format(ctsSourceNotFoundUnit+ErrMsg, [CompiledFilename]),
AnUnitName));
end else begin
// nothing found
RaiseExceptionInstance(
ECodeToolUnitNotFound.Create(Self,
ECodeToolUnitNotFound.Create(Self,20170421200056,
Format(ctsUnitNotFound+ErrMsg,[AnUnitName]),
AnUnitInFilename));
end;
@ -3932,7 +3932,7 @@ var
procedure RaiseInternalError;
begin
RaiseException('[TFindDeclarationTool.FindIdentifierInContext] '
RaiseException(20170421200059,'[TFindDeclarationTool.FindIdentifierInContext] '
+' internal error: Params.ContextNode=nil');
end;
@ -4054,10 +4054,10 @@ var
and (Params.Identifier[0]<>#0) then begin
Identifier:=Params.Identifier[0];
if Identifier='[' then begin
Params.IdentifierTool.RaiseException(ctsDefaultPropertyNotFound);
Params.IdentifierTool.RaiseException(20170421200103,ctsDefaultPropertyNotFound);
end;
end;
Params.IdentifierTool.RaiseExceptionFmt(ctsIdentifierNotFound,
Params.IdentifierTool.RaiseExceptionFmt(20170421200105,ctsIdentifierNotFound,
[Identifier]);
end;
@ -4100,7 +4100,7 @@ var
end;
ctnProcedure:
// function execution is not implemented yet
RaiseException('not implemented');
RaiseException(20170421200108,'not implemented');
end;
if CallOnIdentifierFound then begin
@ -5024,7 +5024,7 @@ begin
Result:=CleanFindContext;
if fdfExceptionOnNotFound in Params.Flags then begin
MoveCursorToCleanPos(EndPos);
RaiseException(ctsNoContextNodeFoundAtCursor);
RaiseException(20170421200111,ctsNoContextNodeFoundAtCursor);
end;
end;
end;
@ -5037,19 +5037,19 @@ var
procedure RaiseForwardClassNameLess;
begin
RaiseException('[TFindDeclarationTool.FindBaseTypeOfNode] '
RaiseException(20170421200114,'[TFindDeclarationTool.FindBaseTypeOfNode] '
+'forward class node without name');
end;
procedure RaiseCircleDefs;
begin
Params.NewCodeTool.RaiseException(ctsCircleInDefinitions
Params.NewCodeTool.RaiseException(20170421200117,ctsCircleInDefinitions
+' ('+ctsIdentifier+'='+GetIdentifier(Params.Identifier)+')');
end;
procedure RaiseInternalError;
begin
Params.IdentifierTool.RaiseException(
Params.IdentifierTool.RaiseException(20170421200121,
'[TFindDeclarationTool.FindBaseTypeOfNode]'
+' internal error: not IsPCharInSrc(Params.Identifier) '
+' Params.IdentifierTool.='
@ -5059,18 +5059,18 @@ var
procedure RaiseBaseTypeOfNotFound;
begin
RaiseExceptionFmt(ctsBaseTypeOfNotFound,[GetIdentifier(Params.Identifier)]);
RaiseExceptionFmt(20170421200124,ctsBaseTypeOfNotFound,[GetIdentifier(Params.Identifier)]);
end;
procedure RaiseClassOfWithoutIdentifier;
begin
RaiseExceptionFmt(ctsBaseTypeOfNotFound+' ("class of")',
RaiseExceptionFmt(20170421200133,ctsBaseTypeOfNotFound+' ("class of")',
[GetIdentifier(Params.Identifier)]);
end;
procedure RaiseForwardNotResolved(ClassIdentNode: TCodeTreeNode);
begin
RaiseExceptionFmt(ctsForwardClassDefinitionNotResolved,
RaiseExceptionFmt(20170421200136,ctsForwardClassDefinitionNotResolved,
[copy(Src,ClassIdentNode.StartPos,
ClassIdentNode.EndPos-ClassIdentNode.StartPos)]);
end;
@ -5078,7 +5078,7 @@ var
procedure RaiseClassOfNotResolved(ClassIdentNode: TCodeTreeNode);
begin
MoveCursorToNodeStart(ClassIdentNode);
RaiseExceptionFmt(ctsClassOfDefinitionNotResolved,
RaiseExceptionFmt(20170421200141,ctsClassOfDefinitionNotResolved,
[copy(Src,ClassIdentNode.StartPos,
ClassIdentNode.EndPos-ClassIdentNode.StartPos)]);
end;
@ -5132,7 +5132,7 @@ var
{$ENDIF}
MoveCursorToCleanPos(IdentStart);
ReadNextAtom;
RaiseExceptionFmt(ctsStrExpectedButAtomFound,
RaiseExceptionFmt(20170421200144,ctsStrExpectedButAtomFound,
[ctsTypeIdentifier,GetAtom]);
end;
Context:=ExprType.Context;
@ -5150,7 +5150,7 @@ var
// => type expected
MoveCursorToCleanPos(IdentStart);
ReadNextAtom; // read AUnitName
SaveRaiseCharExpectedButAtomFound('.');
SaveRaiseCharExpectedButAtomFound(20170421200146,'.');
end;
if TypeFound and (SubParams.NewNode.Desc=ctnGenericParameter) then begin
TypeFound:=SubParams.FindGenericParamType;
@ -5167,7 +5167,7 @@ var
{$ENDIF}
MoveCursorToCleanPos(IdentStart);
ReadNextAtom;
RaiseExceptionFmt(ctsStrExpectedButAtomFound,
RaiseExceptionFmt(20170421200149,ctsStrExpectedButAtomFound,
[ctsTypeIdentifier,GetAtom]);
end;
Context:=TestContext;
@ -5290,7 +5290,7 @@ begin
if NodeExistsInStack(NodeStack,Result.Node) then begin
// cycle detected
Result.Tool.MoveCursorToNodeStart(Result.Node);
Result.Tool.RaiseException(ctsCircleInDefinitions);
Result.Tool.RaiseException(20170421200151,ctsCircleInDefinitions);
end;
{$IFDEF CheckNodeTool}Result.Tool.CheckNodeTool(Result.Node);{$ENDIF}
@ -5430,7 +5430,7 @@ begin
if Params.NewNode.Desc<>ctnProperty then begin
// ancestor is not a property
MoveCursorToCleanPos(OldPos);
RaiseException(ctsAncestorIsNotProperty);
RaiseException(20170421200153,ctsAncestorIsNotProperty);
end;
Result:=TestContext;
end else
@ -5469,7 +5469,7 @@ begin
// not a generic
MoveCursorToNodeStart(NameNode);
ReadNextAtom;
RaiseExceptionFmt(ctsStrExpectedButAtomFound,
RaiseExceptionFmt(20170421200156,ctsStrExpectedButAtomFound,
[ctsGenericIdentifier,GetAtom]);
end;
end else
@ -6005,15 +6005,15 @@ var
begin
MoveCursorToNodeStart(ClassNode);
if BaseClassName='TObject' then
RaiseException(ctsDefaultClassAncestorTObjectNotFound)
RaiseException(20170421200159,ctsDefaultClassAncestorTObjectNotFound)
else if BaseClassName='IInterface' then
RaiseException(ctsDefaultInterfaceAncestorIInterfaceNotFound)
RaiseException(20170421200202,ctsDefaultInterfaceAncestorIInterfaceNotFound)
else if BaseClassName='IDispatch' then
RaiseException(ctsDefaultDispinterfaceAncestorIDispatchNotFound)
RaiseException(20170421200205,ctsDefaultDispinterfaceAncestorIDispatchNotFound)
else if BaseClassName='JLObject' then
RaiseException(ctsDefaultJavaClassAncestorJLObjectNotFound)
RaiseException(20170421200207,ctsDefaultJavaClassAncestorJLObjectNotFound)
else
RaiseException(Format(ctsDefaultAncestorNotFound, [BaseClassName]))
RaiseExceptionFmt(20170421200210,ctsDefaultAncestorNotFound, [BaseClassName]);
end;
begin
@ -6021,7 +6021,7 @@ begin
{$IFDEF CheckNodeTool}CheckNodeTool(ClassNode);{$ENDIF}
if (ClassNode=nil) or (not (ClassNode.Desc in AllClasses))
then
RaiseException('[TFindDeclarationTool.FindDefaultAncestorOfClass] '
RaiseException(20170421200213,'[TFindDeclarationTool.FindDefaultAncestorOfClass] '
+' invalid classnode');
Result:=false;
@ -6616,7 +6616,7 @@ var
if (UsesNode.Desc=ctnUsesSection) then begin
ReadNextAtom;
if not UpAtomIs('USES') then
RaiseUsesExpected;
RaiseUsesExpected(20170421200509);
end;
repeat
ReadNextAtom; // read name
@ -6634,12 +6634,12 @@ var
ReadNextAtom;
if UpAtomIs('IN') then begin
ReadNextAtom;
if not AtomIsStringConstant then RaiseStrConstExpected;
if not AtomIsStringConstant then RaiseStrConstExpected(20170421200522);
ReadNextAtom;
end;
if AtomIsChar(';') then break;
if not AtomIsChar(',') then
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[';',GetAtom])
RaiseExceptionFmt(20170421200217,ctsStrExpectedButAtomFound,[';',GetAtom])
until (CurPos.StartPos>SrcLen);
end;
@ -6721,7 +6721,7 @@ begin
if Node.Desc in [ctnUseUnitNamespace,ctnUseUnitClearName] then
Node:=Node.Parent;
if Node.Desc<>ctnUseUnit then
RaiseException('This function needs the cursor at a unit in a uses clause');
RaiseException(20170421200221,'This function needs the cursor at a unit in a uses clause');
// cursor is on an used unit -> try to locate it
MoveCursorToCleanPos(Node.StartPos);
ReadNextAtom;
@ -6742,7 +6742,7 @@ var
begin
ListOfPCodeXYPosition:=TFPList.Create;
if TargetTool=nil then
RaiseException('TargetTool=nil');
RaiseException(20170421200226,'TargetTool=nil');
TargetTool.BuildInterfaceIdentifierCache(true);
refs:=TFindUsedUnitReferences.Create(Self, FindLastNode);
try
@ -6795,7 +6795,7 @@ begin
begin
if (Node.FirstChild<>nil)
and ((Node.FirstChild.SubDesc and ctnsForwardDeclaration)>0) then
RaiseException('TFindDeclarationTool.CleanPosIsDeclarationIdentifier Node not expanded');
RaiseException(20170421200230,'TFindDeclarationTool.CleanPosIsDeclarationIdentifier Node not expanded');
MoveCursorToProcName(Node,true);
Result:=InNodeIdentifier(CurPos.StartPos);
end;
@ -7126,13 +7126,13 @@ var
procedure RaiseClassNotFound;
begin
MoveCursorToAtomPos(ClassNameAtom);
RaiseExceptionFmt('Class %s not found',[GetAtom]);
RaiseExceptionFmt(20170421200233,'Class %s not found',[GetAtom]);
end;
procedure RaiseNotAClass;
begin
MoveCursorToAtomPos(ClassNameAtom);
RaiseExceptionFmt('Class expected, but %s found',[GetAtom]);
RaiseExceptionFmt(20170421200237,'Class expected, but %s found',[GetAtom]);
end;
begin
@ -7314,7 +7314,7 @@ var
begin
{$IFDEF CheckNodeTool}CheckNodeTool(ClassNode);{$ENDIF}
if (ClassNode=nil) or (not (ClassNode.Desc in AllClasses)) then
RaiseException('[TFindDeclarationTool.FindAncestorOfClass] invalid classnode');
RaiseException(20170421200240,'[TFindDeclarationTool.FindAncestorOfClass] invalid classnode');
Result:=false;
// ToDo: ppu, dcu
@ -7344,7 +7344,7 @@ var
begin
MoveCursorToCleanPos(AncestorStartPos);
ReadNextAtom;
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[Expected,ExtractNode(IdentifierNode,[])]);
RaiseExceptionFmt(20170421200243,ctsStrExpectedButAtomFound,[Expected,ExtractNode(IdentifierNode,[])]);
end;
begin
@ -7354,7 +7354,7 @@ begin
or (IdentifierNode.Parent=nil)
or (IdentifierNode.Parent.Desc<>ctnClassInheritance)
then
RaiseException('[TFindDeclarationTool.FindAncestorOfClass] '
RaiseException(20170421200245,'[TFindDeclarationTool.FindAncestorOfClass] '
+' not an inheritance node');
Result:=false;
@ -7367,7 +7367,7 @@ begin
ReadNextAtom;
if UpAtomIs('SPECIALIZE') then
ReadNextAtom;
RaiseStringExpectedButAtomFound('class type');
RaiseStringExpectedButAtomFound(20170421200248,'class type');
end;
MoveCursorToCleanPos(IdentifierNode.FirstChild.StartPos);
end else
@ -7427,7 +7427,7 @@ begin
if AncestorContext.Node=ClassNode then begin
MoveCursorToCleanPos(AncestorStartPos);
ReadNextAtom;
RaiseException('cycle detected');
RaiseException(20170421200252,'cycle detected');
end;
end else begin
// check if class identifier
@ -7596,7 +7596,7 @@ begin
or (not (WithVarExpr.Context.Node.Desc in (AllClasses+[ctnEnumerationType])))
then begin
MoveCursorToCleanPos(WithVarNode.StartPos);
RaiseException(ctsExprTypeMustBeClassOrRecord);
RaiseException(20170421200254,ctsExprTypeMustBeClassOrRecord);
end;
// search identifier in 'with' context
// Note: do not search in parent nodes (e.g. with ListBox1 do Items)
@ -7789,18 +7789,18 @@ var
procedure RaiseBinaryOperatorNotFound;
begin
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsBinaryOperator,GetAtom]);
RaiseExceptionFmt(20170421200256,ctsStrExpectedButAtomFound,[ctsBinaryOperator,GetAtom]);
end;
procedure RaiseInternalError;
begin
RaiseException('[TFindDeclarationTool.FindExpressionResultType]'
RaiseException(20170421200300,'[TFindDeclarationTool.FindExpressionResultType]'
+' internal error: unknown precedence lvl for operator '+GetAtom);
end;
procedure RaiseInternalErrorStack;
begin
RaiseException('[TFindDeclarationTool.FindExpressionResultType]'
RaiseException(20170421200303,'[TFindDeclarationTool.FindExpressionResultType]'
+' internal error: stackptr too big ');
end;
@ -7919,7 +7919,8 @@ var
begin
AnUnitName:=ExtractUsedUnitName(MissingUnit,@InFilename);
RaiseExceptionInstance(
ECodeToolUnitNotFound.Create(Self,Format(ctsUnitNotFound,[AnUnitName]),InFilename));
ECodeToolUnitNotFound.Create(Self,20170421200312,
Format(ctsUnitNotFound,[AnUnitName]),InFilename));
end;
var
@ -8013,7 +8014,7 @@ begin
if (NewCode=nil) then begin
// no source found
if ExceptionOnNotFound then
RaiseException('unit '+AnUnitName+' not found');
RaiseException(20170421200315,'unit '+AnUnitName+' not found');
end else begin
// source found -> get codetool for it
{$IF defined(ShowTriedFiles) or defined(ShowTriedUnits)}
@ -8188,8 +8189,8 @@ begin
MoveCursorToNodeStart(Tree.Root);
ReadNextAtom; // read keyword for source type, e.g. 'unit'
if not UpAtomIs('UNIT') then
RaiseException(ctsSourceIsNotUnit);
RaiseException(ctsInterfaceSectionNotFound);
RaiseException(20170421200317,ctsSourceIsNotUnit);
RaiseException(20170421200319,ctsInterfaceSectionNotFound);
end;
end;
@ -8257,16 +8258,16 @@ begin
Result:=Tree.Root;
if Result=nil then begin
CurPos.StartPos:=-1;
RaiseException('[TFindDeclarationTool.GetInterfaceNode] no code tree found');
RaiseException(20170421200323,'[TFindDeclarationTool.GetInterfaceNode] no code tree found');
end;
if not (Tree.Root.Desc in AllUsableSourceTypes) then begin
CurPos.StartPos:=-1;
RaiseException(ctsUsedUnitIsNotAPascalUnit);
RaiseException(20170421200325,ctsUsedUnitIsNotAPascalUnit);
end;
Result:=FindInterfaceNode;
if Result=nil then begin
CurPos.StartPos:=-1;
RaiseException(ctsInterfaceSectionNotFound);
RaiseException(20170421200327,ctsInterfaceSectionNotFound);
end;
end;
@ -8289,7 +8290,7 @@ begin
DebugLn('WARNING: Searching again in hidden unit: "',NewCode.Filename,'" identifier=',GetIdentifier(Params.Identifier));
NewCodeTool:=Self;
CurPos.StartPos:=ErrorPos;
RaiseExceptionFmt(ctsIllegalCircleInUsedUnits,[AnUnitName]);
RaiseExceptionFmt(20170421200330,ctsIllegalCircleInUsedUnits,[AnUnitName]);
end else begin
// source found -> get codetool for it
{$IF defined(ShowTriedContexts) or defined(ShowTriedUnits)}
@ -8300,12 +8301,14 @@ begin
NewCodeTool:=nil;
if not Assigned(FOnGetCodeToolForBuffer) then begin
CurPos.StartPos:=ErrorPos;
RaiseException(Format('Unable to create codetool for "%s", need OnGetCodeToolForBuffer',[NewCode.Filename]));
RaiseExceptionFmt(20170421200333,
'Unable to create codetool for "%s", need OnGetCodeToolForBuffer',
[NewCode.Filename]);
end;
NewCodeTool:=FOnGetCodeToolForBuffer(Self,NewCode,false);
if NewCodeTool=nil then begin
CurPos.StartPos:=ErrorPos;
RaiseException(Format('Unable to create codetool for "%s"',[NewCode.Filename]));
RaiseExceptionFmt(20170421200346,'Unable to create codetool for "%s"',[NewCode.Filename]);
end;
// search the identifier in the interface of the used unit
OldFlags:=Params.Flags;
@ -8359,14 +8362,14 @@ begin
end;
end;
procedure TFindDeclarationTool.RaiseUsesExpected;
procedure TFindDeclarationTool.RaiseUsesExpected(id: int64);
begin
RaiseExceptionFmt(ctsStrExpectedButAtomFound,['"uses"',GetAtom]);
RaiseExceptionFmt(id,ctsStrExpectedButAtomFound,['"uses"',GetAtom]);
end;
procedure TFindDeclarationTool.RaiseStrConstExpected;
procedure TFindDeclarationTool.RaiseStrConstExpected(id: int64);
begin
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsStringConstant,GetAtom]);
RaiseExceptionFmt(id,ctsStrExpectedButAtomFound,[ctsStringConstant,GetAtom]);
end;
procedure TFindDeclarationTool.BeginParsing(Range: TLinkScannerRange);
@ -8429,7 +8432,7 @@ function TFindDeclarationTool.FindEndOfTerm(
}
procedure RaiseIdentNotFound;
begin
RaiseExceptionFmt(ctsIdentExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421200525,ctsIdentExpectedButAtomFound,[GetAtom]);
end;
var
@ -8518,7 +8521,7 @@ function TFindDeclarationTool.FindStartOfTerm(EndPos: integer; InType: boolean
}
procedure RaiseIdentNotFound;
begin
RaiseExceptionFmt(ctsIdentExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421200528,ctsIdentExpectedButAtomFound,[GetAtom]);
end;
var CurAtom, NextAtom: TAtomPosition;
@ -8634,34 +8637,34 @@ var
procedure RaiseIdentExpected;
begin
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsIdentifier,GetAtom]);
RaiseExceptionFmt(20170421200530,ctsStrExpectedButAtomFound,[ctsIdentifier,GetAtom]);
end;
procedure RaiseIdentNotFound;
begin
RaiseExceptionFmt(ctsIdentifierNotFound,[GetAtom]);
RaiseExceptionFmt(20170421200532,ctsIdentifierNotFound,[GetAtom]);
end;
procedure RaiseIllegalQualifierFound;
begin
RaiseExceptionFmt(ctsIllegalQualifier,[GetAtom]);
RaiseExceptionFmt(20170421200535,ctsIllegalQualifier,[GetAtom]);
end;
procedure RaisePointNotFound;
begin
RaiseExceptionFmt(ctsStrExpectedButAtomFound,['.',GetAtom]);
RaiseExceptionFmt(20170421200537,ctsStrExpectedButAtomFound,['.',GetAtom]);
end;
procedure RaiseClassDeclarationNotFound(Tool: TFindDeclarationTool);
begin
Tool.RaiseExceptionFmt(ctsClassSNotFound, [Tool.GetAtom]);
Tool.RaiseExceptionFmt(20170421200539,ctsClassSNotFound, [Tool.GetAtom]);
end;
function InitAtomQueue: boolean;
procedure RaiseInternalError;
begin
RaiseException('internal codetool error: FindExpressionTypeOfVariable '
RaiseException(20170421200543,'internal codetool error: FindExpressionTypeOfVariable '
+' StartPos='+IntToStr(StartPos)+' EndPos='+IntToStr(EndPos));
end;
@ -9119,7 +9122,7 @@ var
begin
IsStart:=ExprType.Desc=xtNone;
if not IsStart then
RaiseExceptionFmt(ctsOperatorExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421200546,ctsOperatorExpectedButAtomFound,[GetAtom]);
if AtomIsStringConstant then begin
// string or char constant
if AtomIsCharConstant then
@ -9136,7 +9139,7 @@ var
ExprType.Desc:=xtConstOrdInteger;
MoveCursorToCleanPos(CurPos.EndPos);
end else
RaiseExceptionFmt(ctsOperatorExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421200548,ctsOperatorExpectedButAtomFound,[GetAtom]);
end;
procedure ResolveUseUnit;
@ -9291,7 +9294,7 @@ var
if (ExprType.Context.Node=nil)
or (ExprType.Context.Node.Desc<>ctnPointerType) then begin
MoveCursorToCleanPos(CurAtom.StartPos);
RaiseExceptionFmt(ctsIllegalQualifier,['^']);
RaiseExceptionFmt(20170421200550,ctsIllegalQualifier,['^']);
end;
ExprType.Desc:=xtContext;
ExprType.Context.Node:=ExprType.Context.Node.FirstChild;
@ -9316,13 +9319,13 @@ var
procedure RaiseTypeIdentNotFound;
begin
ExprType.Context.Tool.RaiseExceptionFmt(ctsStrExpectedButAtomFound,
ExprType.Context.Tool.RaiseExceptionFmt(20170421200553,ctsStrExpectedButAtomFound,
[ctsTypeIdentifier,ExprType.Context.Tool.GetAtom]);
end;
procedure RaiseIdentInCurContextNotFound;
begin
ExprType.Context.Tool.RaiseExceptionFmt(ctsStrExpectedButAtomFound,
ExprType.Context.Tool.RaiseExceptionFmt(20170421200557,ctsStrExpectedButAtomFound,
[ctsIdentifier,GetAtom]);
end;
begin
@ -9521,7 +9524,7 @@ var
ProcNode:=GetMethodOfBody(Context.Node);
if ProcNode=nil then begin
MoveCursorToCleanPos(CurAtom.StartPos);
RaiseException(ctsInheritedKeywordOnlyAllowedInMethods);
RaiseException(20170421200601,ctsInheritedKeywordOnlyAllowedInMethods);
end;
HasIdentifier:=NextAtom.EndPos<=EndPos;
if HasIdentifier then begin
@ -9580,7 +9583,7 @@ var
DefProcNode:=FindCorrespondingProcNode(ProcNode);
if DefProcNode=nil then begin
MoveCursorToProcName(ProcNode,true);
RaiseExceptionFmt(ctsMethodSignatureSNotFoundInClass, [GetAtom]);
RaiseExceptionFmt(20170421200604,ctsMethodSignatureSNotFoundInClass, [GetAtom]);
end;
MoveCursorToProcName(DefProcNode,true);
end else begin
@ -9820,7 +9823,7 @@ var EndPos, SubStartPos: integer;
procedure RaiseConstExpected;
begin
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsConstant,GetAtom]);
RaiseExceptionFmt(20170421200607,ctsStrExpectedButAtomFound,[ctsConstant,GetAtom]);
end;
begin
@ -9849,7 +9852,7 @@ var EndPos, SubStartPos: integer;
procedure RaiseIdentExpected;
begin
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsIdentifier,GetAtom]);
RaiseExceptionFmt(20170421200609,ctsStrExpectedButAtomFound,[ctsIdentifier,GetAtom]);
end;
var
@ -10166,7 +10169,7 @@ begin
end else begin
MoveCursorToCleanPos(BinaryOperator.EndPos);
ReadNextAtom;
RaiseExceptionFmt(ctsIncompatibleTypesGotExpected,
RaiseExceptionFmt(20170421200612,ctsIncompatibleTypesGotExpected,
['char',ExpressionTypeDescNames[RightOperand.Expr.Desc]]);
end;
end else if (Src[BinaryOperator.StartPos] in ['+','-','*'])
@ -10362,7 +10365,7 @@ begin
inc(i);
end;
if (ParamNode<>nil) or (i<TargetExprParamList.Count) then
RaiseException('Internal Error: one param list has changed');
RaiseException(20170421200618,'Internal Error: one param list has changed');
{$IFDEF ShowExprEval}
finally
@ -10926,7 +10929,7 @@ var ExprType: TExpressionType;
procedure RaiseBracketNotFound;
begin
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[BracketClose,GetAtom]);
RaiseExceptionFmt(20170421200621,ctsStrExpectedButAtomFound,[BracketClose,GetAtom]);
end;
begin
@ -11044,7 +11047,7 @@ function TFindDeclarationTool.ContextIsDescendOf(const DescendContext,
procedure RaiseInternalError;
begin
RaiseException('[TFindDeclarationTool.ContextIsDescendOf] '
RaiseException(20170421200624,'[TFindDeclarationTool.ContextIsDescendOf] '
+' internal error: DescendContext.Desc<>ctnClass');
end;
@ -11203,9 +11206,9 @@ function TFindDeclarationTool.CheckParameterSyntax(StartPos,
procedure RaiseBracketNotOpened;
begin
if CurPos.Flag=cafRoundBracketClose then
RaiseExceptionFmt(ctsBracketNotFound,['('])
RaiseExceptionFmt(20170421200628,ctsBracketNotFound,['('])
else
RaiseExceptionFmt(ctsBracketNotFound,['[']);
RaiseExceptionFmt(20170421200630,ctsBracketNotFound,['[']);
end;
function CheckIdentifierAndParameterList: boolean; forward;
@ -12081,7 +12084,7 @@ function TFindDeclarationTool.FindForInTypeAsString(TermPos: TAtomPosition;
if TermPos.StartPos<1 then
TermPos.StartPos:=1;
MoveCursorToCleanPos(TermPos.StartPos);
RaiseException('Can not find an enumerator for '''+TrimCodeSpace(GetAtom(TermPos))+'''');
RaiseException(20170421200635,'Can not find an enumerator for '''+TrimCodeSpace(GetAtom(TermPos))+'''');
end;
var
@ -12244,7 +12247,7 @@ begin
if not FindIdentifierInContext(Params) then begin
if ExceptionOnNotFound then begin
MoveCursorToCleanPos(ClassNode.StartPos);
RaiseException(ctsFunctionGetEnumeratorNotFoundInThisClass);
RaiseException(20170421200638,ctsFunctionGetEnumeratorNotFoundInThisClass);
end else begin
{$IFDEF ShowForInEval}
debugln(['TFindDeclarationTool.FindEnumeratorOfClass GetEnumerator not found for ',ExtractClassName(ClassNode,false)]);
@ -12258,7 +12261,7 @@ begin
if (ProcNode=nil) or (ProcNode.Desc<>ctnProcedure) then begin
if ExceptionOnNotFound then begin
MoveCursorToCleanPos(ClassNode.StartPos);
RaiseException(ctsFunctionGetEnumeratorNotFoundInThisClass2);
RaiseException(20170421200640,ctsFunctionGetEnumeratorNotFoundInThisClass2);
end else begin
{$IFDEF ShowForInEval}
debugln(['TFindDeclarationTool.FindEnumeratorOfClass GetEnumerator is not a proc, class=',ExtractClassName(ClassNode,false)]);
@ -12277,7 +12280,7 @@ begin
then begin
if ExceptionOnNotFound then begin
ProcTool.MoveCursorToCleanPos(ProcNode.StartPos);
ProcTool.RaiseException(ctsResultTypeOfFunctionGetEnumeratorNotFound);
ProcTool.RaiseException(20170421200642,ctsResultTypeOfFunctionGetEnumeratorNotFound);
end else
exit;
end;
@ -12302,7 +12305,7 @@ begin
if (PropNode=nil) or (PropNode.Desc<>ctnProperty) then begin
if ExceptionOnNotFound then begin
EnumeratorContext.Tool.MoveCursorToCleanPos(EnumeratorContext.Node.StartPos);
RaiseException(ctsPropertyCurrentNotFound);
RaiseException(20170421200644,ctsPropertyCurrentNotFound);
end else begin
{$IFDEF ShowForInEval}
DebugLn(['TFindDeclarationTool.FindEnumeratorOfClass "current" is not a property']);
@ -12389,7 +12392,7 @@ begin
ctnClass,ctnObject,ctnRecordType,ctnClassInterface: ;
else
OperatorTool.MoveCursorToNodeStart(OperatorNode);
OperatorTool.RaiseException('operator enumerator result type is not object');
OperatorTool.RaiseException(20170421200650,'operator enumerator result type is not object');
end;
if Need=foeResultClassNode then begin
ResultExprType.Desc:=xtContext;
@ -12407,7 +12410,7 @@ begin
{$ENDIF}
if not ClassContext.Tool.FindIdentifierInContext(Params) then begin
ClassContext.Tool.MoveCursorToNodeStart(ClassContext.Node);
ClassContext.Tool.RaiseException('enumerator ''current'' not found');
ClassContext.Tool.RaiseException(20170421200654,'enumerator ''current'' not found');
end;
EnumeratorCurrentTool:=Params.NewCodeTool;
EnumeratorCurrentNode:=Params.NewNode;
@ -12465,7 +12468,7 @@ begin
or (Params.NewNode.FirstChild.Desc<>ctnEnumerationType) then begin
MoveCursorToCleanPos(p);
ReadNextAtom;
RaiseStringExpectedButAtomFound(ctsEnumerationType);
RaiseStringExpectedButAtomFound(20170421200656,ctsEnumerationType);
end;
Context.Tool:=Params.NewCodeTool;
Context.Node:=Params.NewNode;
@ -12754,7 +12757,7 @@ function TFindDeclarationTool.FindExprTypeAsString(
if TermCleanPos<1 then
TermCleanPos:=1;
MoveCursorToCleanPos(TermCleanPos);
RaiseException(ctsTermNotSimple);
RaiseException(20170421200658,ctsTermNotSimple);
end;
var
@ -13325,19 +13328,19 @@ begin
ReadNextAtom;
// maybe all this syntax check is redundant
if not AtomIsChar('<') then
RaiseExceptionFmt(ctsStrExpectedButAtomFound,['<']);
RaiseExceptionFmt(20170421200701,ctsStrExpectedButAtomFound,['<']);
ReadNextAtom;
if CurPos.Flag<>cafWord then
RaiseExceptionFmt(ctsIdentExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421200703,ctsIdentExpectedButAtomFound,[GetAtom]);
for i:=2 to n do begin
ReadNextAtom;
if AtomIsChar('>') then
RaiseException(ctsNotEnoughGenParams);
RaiseException(20170421200705,ctsNotEnoughGenParams);
if not AtomIsChar(',') then
RaiseExceptionFmt(ctsStrExpectedButAtomFound,['>']);
RaiseExceptionFmt(20170421200707,ctsStrExpectedButAtomFound,['>']);
ReadNextAtom;
if CurPos.Flag<>cafWord then
RaiseExceptionFmt(ctsIdentExpectedButAtomFound,[GetAtom]);
RaiseExceptionFmt(20170421200710,ctsIdentExpectedButAtomFound,[GetAtom]);
end;
Identifier:=@Src[CurPos.StartPos];
IdentifierTool:=GenParams.ParamValuesTool;

View File

@ -2082,7 +2082,7 @@ var
begin
CursorPos.Code.LineColToPosition(CursorPos.Y,CursorPos.X,p);
if p<1 then
RaiseException(ctsCursorPosOutsideOfCode);
RaiseException(20170421201041,ctsCursorPosOutsideOfCode);
if CursorPos.X<=CursorPos.Code.GetLineLength(CursorPos.Y-1)+1 then begin
GetIdentStartEndAtPosition(CursorPos.Code.Source,p,IdentStartPos,IdentEndPos);
end else begin
@ -3386,7 +3386,7 @@ begin
or (not (CursorNode.Desc in AllClassObjects))
or ((CursorNode.SubDesc and ctnsForwardDeclaration)>0) then begin
MoveCursorToCleanPos(CleanCursorPos);
RaiseException('TIdentCompletionTool.FindAbstractMethods cursor is not in a class');
RaiseException(20170421201053,'TIdentCompletionTool.FindAbstractMethods cursor is not in a class');
end;
ClassNode:=CursorNode;

View File

@ -77,6 +77,10 @@ msgstr "no s'ha trobat %s"
msgid "bracket open expected, but %s found"
msgstr "S'esperava claudàtor d'obrir, però s'ha trobat %s"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr ""
@ -99,6 +103,10 @@ msgstr "node classe sense node pare"
msgid "class \"%s\" not found"
msgstr "no s'ha trobat la classe %s%s%s"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "No s'ha resolt la definició de \"class of \": %s"
@ -523,6 +531,10 @@ msgstr ""
msgid "invalid operator %s"
msgstr ""
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "sotabast no és vàlid"
@ -563,6 +575,10 @@ msgstr "Directori principal del Lazarus"
msgid "Lazarus Sources"
msgstr "Fonts del Lazarus"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "nom del mètode"

View File

@ -79,6 +79,10 @@ msgstr "závorka %s nenalezena"
msgid "bracket open expected, but %s found"
msgstr "očekávána otvírací závorka, ale nalezeno %s "
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "znaková konstanta mimo rozsah"
@ -101,6 +105,10 @@ msgstr "uzel třídy bez rodičovského uzlu"
msgid "class \"%s\" not found"
msgstr "třída %s%s%s nenalezena"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "definice \"class of\" nebyla rozpoznána: %s"
@ -523,6 +531,10 @@ msgstr "neplatný přepínač režimu \"%s\""
msgid "invalid operator %s"
msgstr "neplatný opetátor %s"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "neplatný podrozsah"
@ -563,6 +575,10 @@ msgstr "hlavní adresář lazarusu"
msgid "Lazarus Sources"
msgstr "Zdroje Lazarusu"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "jméno metody"

View File

@ -80,6 +80,10 @@ msgstr "Klammer %s nicht gefunden"
msgid "bracket open expected, but %s found"
msgstr "öffnende Klammer erwartet aber %s gefunden"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr ""
@ -100,6 +104,10 @@ msgstr "Klassenknoten ohne Elternknoten"
msgid "class \"%s\" not found"
msgstr "Klasse \"%s\" nicht gefunden"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "Die Definition \"Class of\" ist nicht aufgelöst: %s"
@ -518,6 +526,10 @@ msgstr "Ungültiger Modus-Schalter \"%s\""
msgid "invalid operator %s"
msgstr "ungültger Operator %s"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "ungültiger Teilbereich"
@ -554,6 +566,10 @@ msgstr "Lazarus-Hauptverzeichnis"
msgid "Lazarus Sources"
msgstr "Lazarus-Quellen"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "Methodenname"

View File

@ -77,6 +77,10 @@ msgstr "paréntesis %s no encontrado"
msgid "bracket open expected, but %s found"
msgstr "se esperaba paréntesis abierto, pero se encontró %s"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "constante de caracteres fuera del rango"
@ -97,6 +101,10 @@ msgstr "nodo class sin nodo parent"
msgid "class \"%s\" not found"
msgstr "clase \"%s\" no encontrada"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "\"class of\" definición sin resolver: %s"
@ -515,6 +523,10 @@ msgstr "interruptor de modo no válido \"%s\""
msgid "invalid operator %s"
msgstr "operador no válido %s"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "subrango no válido"
@ -551,6 +563,10 @@ msgstr "Directorio principal de Lazarus"
msgid "Lazarus Sources"
msgstr "Fuentes de Lazarus"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "nombre de método"

View File

@ -72,6 +72,10 @@ msgstr "sulkua %s ei löydy"
msgid "bracket open expected, but %s found"
msgstr "odotettiin avaavaa sulkua, saatiin %s"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "merkkivakio sallitun alueen ulkopuolella"
@ -92,6 +96,10 @@ msgstr "lapsisolmu ilman emosolmua"
msgid "class \"%s\" not found"
msgstr "luokkaa \"%s\" ei löydy"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "\"class of\" määritystä ei löydy: %s"
@ -510,6 +518,10 @@ msgstr "Kelvoton moodin valitsin \"%s\""
msgid "invalid operator %s"
msgstr "Kelvoton operaattori %s"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "Kelvoton osaväli"
@ -546,6 +558,10 @@ msgstr "lazarus päähakemisto"
msgid "Lazarus Sources"
msgstr "Lazarus lähdekoodit"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "metodin nimi"

View File

@ -80,6 +80,10 @@ msgstr "parenthèse %s non trouvée"
msgid "bracket open expected, but %s found"
msgstr "parenthèse ouvrante attendue, mais %s trouvé"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "constante caractère hors plage"
@ -100,6 +104,10 @@ msgstr "nœud de classe sans nœud de parent"
msgid "class \"%s\" not found"
msgstr "classe \"%s\" non trouvée"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "définition de \"class of\" non résolue : %s"
@ -518,6 +526,10 @@ msgstr "commutateur de mode incorrect : \"%s\""
msgid "invalid operator %s"
msgstr "opérateur incorrect : %s"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "plage incorrecte"
@ -554,6 +566,10 @@ msgstr "répertoire principal de Lazarus"
msgid "Lazarus Sources"
msgstr "Sources de Lazarus"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "nom de la méthode"

View File

@ -84,6 +84,10 @@ msgstr "סוגר s% לא נמצא"
msgid "bracket open expected, but %s found"
msgstr "צפויה פתיחת סוגריים, אבל s% נמצא"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "קבוע תו מחוץ לתחום"
@ -106,6 +110,10 @@ msgstr "צומת של מחלקה ללא הורה"
msgid "class \"%s\" not found"
msgstr "המחלקה %s%s%s לא נמצאה"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
#, fuzzy,badformat
msgid "\"class of\" definition not resolved: %s"
@ -547,6 +555,10 @@ msgstr "מתג מצב לא חוקי \"%s\""
msgid "invalid operator %s"
msgstr "אופרטור לא חוקי %s"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "תת תחום לא חוקי"
@ -588,6 +600,10 @@ msgstr "התיקייה הראשית של לזארוס"
msgid "Lazarus Sources"
msgstr "הקוד של לזארוס"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "שם מתודה"

View File

@ -79,6 +79,10 @@ msgstr "a %s zárójel nem található"
msgid "bracket open expected, but %s found"
msgstr "nyitó zárójel az elvárt, de %s található"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "a karakterkonstans a tartományon kívülre esik"
@ -99,6 +103,10 @@ msgstr "osztálycsomópont szülő csomópont nélkül"
msgid "class \"%s\" not found"
msgstr "Az osztály nem található: \"%s\""
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "A \"class of\" definíció nincs feloldva: %s"
@ -517,6 +525,10 @@ msgstr "érvénytelen mód kapcsoló: %s"
msgid "invalid operator %s"
msgstr "érvénytelen művelet: %s"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "érvénytelen tartomány"
@ -553,6 +565,10 @@ msgstr "a Lazarus fő könyvtára"
msgid "Lazarus Sources"
msgstr "Lazarus források"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "metódusnév"

View File

@ -78,6 +78,10 @@ msgstr "kurung %s tidak ditemukan"
msgid "bracket open expected, but %s found"
msgstr "kurung buka diharapkan, tapi %s ditemukan"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr ""
@ -100,6 +104,10 @@ msgstr "node class tanpa node parent"
msgid "class \"%s\" not found"
msgstr "kelas %s%s%s tidak ditemukan"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "definisi \"class of\" tidak terpecahkan: %s"
@ -525,6 +533,10 @@ msgstr ""
msgid "invalid operator %s"
msgstr ""
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "sub jangkauan tidak benar"
@ -565,6 +577,10 @@ msgstr "direktori utama lazarus"
msgid "Lazarus Sources"
msgstr "Sumber Lazarus"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "nama method"

View File

@ -77,6 +77,10 @@ msgstr "parentesi %s non trovata"
msgid "bracket open expected, but %s found"
msgstr "era prevista una parentesi aperta invece è stato trovato %s"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "costante carattere fuori dal limite"
@ -97,6 +101,10 @@ msgstr "nodo classe senza nodo genitore"
msgid "class \"%s\" not found"
msgstr "classe \"%s\" non trovata"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "definizione \"class of\" non risolta: %s"
@ -515,6 +523,10 @@ msgstr "selettore di modo \"%s\" non valido"
msgid "invalid operator %s"
msgstr "operatore %s non valido"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "subrange non valido"
@ -551,6 +563,10 @@ msgstr "directory principale di Lazarus"
msgid "Lazarus Sources"
msgstr "Sorgenti di Lazarus"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "nome metodo"

View File

@ -79,6 +79,10 @@ msgstr "%s skliaustas nerastas"
msgid "bracket open expected, but %s found"
msgstr "tikėtasi atidarančiojo skliausto, tačiau aptikta %s"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "simbolinė konstanta peržengia ribas"
@ -101,6 +105,10 @@ msgstr "klasės mazgas neturi tėvinio mazgo"
msgid "class \"%s\" not found"
msgstr "klasė %s%s%s nerasta"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "„class of“ apibrėžtis nenustatyta: %s"
@ -524,6 +532,10 @@ msgstr "veiksenos perjungiklis „%s“ yra klaidingas"
msgid "invalid operator %s"
msgstr "Klaidingas operatorius „%s“<"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "klaidingas porėžis"
@ -564,6 +576,10 @@ msgstr "Lazarus pagrindinis aplankas"
msgid "Lazarus Sources"
msgstr "Lazarus pirminis kodas"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "metodo pavadinimas"

View File

@ -77,6 +77,10 @@ msgstr ""
msgid "bracket open expected, but %s found"
msgstr ""
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr ""
@ -99,6 +103,10 @@ msgstr ""
msgid "class \"%s\" not found"
msgstr "klasse \"%s\" niet gevonden"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr ""
@ -523,6 +531,10 @@ msgstr ""
msgid "invalid operator %s"
msgstr ""
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr ""
@ -563,6 +575,10 @@ msgstr "lazarus hoofd directory"
msgid "Lazarus Sources"
msgstr ""
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr ""

View File

@ -81,6 +81,10 @@ msgstr "nie znaleziono nawiasu %s"
msgid "bracket open expected, but %s found"
msgstr "zamiast otwarcia nawiasu znaleziono: %s"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr ""
@ -103,6 +107,10 @@ msgstr "brakuje nazwy przodka"
msgid "class \"%s\" not found"
msgstr "Nie znaleziono klasy %s%s%s"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "definicja \"class of\" nie została ustalona: %s"
@ -527,6 +535,10 @@ msgstr ""
msgid "invalid operator %s"
msgstr ""
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "błędny podzakres"
@ -567,6 +579,10 @@ msgstr "główny katalog lazarusa"
msgid "Lazarus Sources"
msgstr "źródła lazarusa"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "nazwa metody"

View File

@ -72,6 +72,10 @@ msgstr ""
msgid "bracket open expected, but %s found"
msgstr ""
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr ""
@ -92,6 +96,10 @@ msgstr ""
msgid "class \"%s\" not found"
msgstr ""
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr ""
@ -510,6 +518,10 @@ msgstr ""
msgid "invalid operator %s"
msgstr ""
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr ""
@ -546,6 +558,10 @@ msgstr ""
msgid "Lazarus Sources"
msgstr ""
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr ""

View File

@ -78,6 +78,10 @@ msgstr "parentêses %s não encontrado"
msgid "bracket open expected, but %s found"
msgstr "esperado parentêses de abertura, mas %s encontrado"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "constante caractere fora de faixa"
@ -100,6 +104,10 @@ msgstr "nó classe sem nó pai"
msgid "class \"%s\" not found"
msgstr "classe %s%s%s não encontrada"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "\"classe de\" definição não resolvida: %s"
@ -522,6 +530,10 @@ msgstr "opção \"modo\" inválida \"%s\""
msgid "invalid operator %s"
msgstr "operador %s inválido"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "subfaixa inválida"
@ -562,6 +574,10 @@ msgstr "diretório principal do Lazarus"
msgid "Lazarus Sources"
msgstr "Fontes do Lazarus"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "nome de método"

View File

@ -79,6 +79,10 @@ msgstr "скобка %s не найдена"
msgid "bracket open expected, but %s found"
msgstr "ожидается открывающая скобка, но найдено %s"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "символьная константа имеет недопустимое значение"
@ -99,6 +103,10 @@ msgstr "описание класса без предка"
msgid "class \"%s\" not found"
msgstr "класс \"%s\" не найден"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "Не найдено ранее упомянутое \"class of\": %s"
@ -517,6 +525,10 @@ msgstr "неверный переключатель режима \"%s\""
msgid "invalid operator %s"
msgstr "неверный оператор %s"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "неверный поддиапазон"
@ -553,6 +565,10 @@ msgstr "главный каталог lazarus"
msgid "Lazarus Sources"
msgstr "Исходный код Lazarus"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "имя метода"

View File

@ -78,6 +78,10 @@ msgstr ""
msgid "bracket open expected, but %s found"
msgstr ""
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr ""
@ -100,6 +104,10 @@ msgstr ""
msgid "class \"%s\" not found"
msgstr "trieda %s%s%s nenájdená"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr ""
@ -522,6 +530,10 @@ msgstr ""
msgid "invalid operator %s"
msgstr ""
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr ""
@ -562,6 +574,10 @@ msgstr ""
msgid "Lazarus Sources"
msgstr ""
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr ""

View File

@ -80,6 +80,10 @@ msgstr "не знайдено дужку %s"
msgid "bracket open expected, but %s found"
msgstr "очікується відкрита дужка, але знайдено %s"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr "символьна константа поза допустимими межами"
@ -100,6 +104,10 @@ msgstr "опис класу без предка"
msgid "class \"%s\" not found"
msgstr "не знайдено клас \"%s\""
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "Не знайдено раніше згаданий \"class of\": %s"
@ -518,6 +526,10 @@ msgstr "неправильний перемикач режиму \"%s\""
msgid "invalid operator %s"
msgstr "невірний оператор %s"
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "неправильний піддіапазон"
@ -554,6 +566,10 @@ msgstr "головна тека Lazarus"
msgid "Lazarus Sources"
msgstr "Сирці Lazarus"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "назва методу"

View File

@ -80,6 +80,10 @@ msgstr "括号 %s 未找到"
msgid "bracket open expected, but %s found"
msgstr "左括号应该出现, 但是找到 %s"
#: codetoolsstrconsts.ctscannotaddaunittotheimplementationbecauseonlyaunith
msgid "can not add a unit to the implementation, because only a unit has one"
msgstr ""
#: codetoolsstrconsts.ctscharacterconstantoutofrange
msgid "character constant out of range"
msgstr ""
@ -102,6 +106,10 @@ msgstr "class node without parent node"
msgid "class \"%s\" not found"
msgstr "未找到类 %s%s%s"
#: codetoolsstrconsts.ctsclassnotfound2
msgid "class not found \"%s\""
msgstr ""
#: codetoolsstrconsts.ctsclassofdefinitionnotresolved
msgid "\"class of\" definition not resolved: %s"
msgstr "\"class of\" definition not resolved: %s"
@ -527,6 +535,10 @@ msgstr ""
msgid "invalid operator %s"
msgstr ""
#: codetoolsstrconsts.ctsinvalidpositionforinsertionofstatements
msgid "invalid position for insertion of statements"
msgstr ""
#: codetoolsstrconsts.ctsinvalidsubrange
msgid "invalid subrange"
msgstr "无效子界"
@ -567,6 +579,10 @@ msgstr "Lazarus 主目录."
msgid "Lazarus Sources"
msgstr "Lazarus 源代码"
#: codetoolsstrconsts.ctsmethodhasnodeclaration
msgid "method \"%s\" has no declaration"
msgstr ""
#: codetoolsstrconsts.ctsmethodname
msgid "method name"
msgstr "method 名称"

View File

@ -44,8 +44,8 @@ uses
// LazUtils
LazFileUtils,
// Codetools
FileProcs, CodeTree, PascalParserTool, StdCodeTools, KeywordFuncLists,
BasicCodeTools, LinkScanner, CodeCache, PascalReaderTool;
FileProcs, CodeTree, CodeToolsStrConsts, PascalParserTool, StdCodeTools,
KeywordFuncLists, BasicCodeTools, LinkScanner, CodeCache, PascalReaderTool;
type
@ -545,7 +545,7 @@ begin
{$ENDIF}
if ClassNode=nil then begin
MoveCursorToProcName(ProcNode,false);
RaiseException('class not found "'+SearchedClassname+'"');
RaiseExceptionFmt(20170421201402,ctsClassNotFound2, [SearchedClassname]);
end;
// search first class grand child node
StartNode:=ClassNode.FirstChild;
@ -557,7 +557,7 @@ begin
if StartNode=nil then begin
ProcName:=ExtractProcName(ProcNode,[]);
MoveCursorToNodeStart(ClassNode);
RaiseException('method "'+ProcName+'" has no declaration');
RaiseExceptionFmt(20170421201417,ctsMethodHasNoDeclaration, [ProcName]);
end;
// search method with same name and param list
Result:=FindBestProcNode(ProcNode,[phpWithoutClassName,phpInUpperCase],
@ -587,7 +587,7 @@ begin
if SearchInNodes.Count=0 then begin
ProcName:=ExtractProcName(ProcNode,[]);
MoveCursorToNodeStart(ClassNode);
RaiseException('method "'+ProcName+'" has no declaration');
RaiseExceptionFmt(20170421201432,ctsMethodHasNoDeclaration, [ProcName]);
end;
// search for a method with same name but different param list
ProcNode:=FindProcNodeInTreeWithName(SearchInNodes,

View File

@ -111,7 +111,7 @@ begin
end;
inc(i);
end;
RaiseException(
RaiseException(20170421194930,
'[TMultiKeyWordListCodeTool.SetCurKeyWordFuncList] unknown list',true);
end;

File diff suppressed because it is too large Load Diff

View File

@ -84,7 +84,7 @@ type
TPascalReaderTool = class(TPascalParserTool)
protected
CachedSourceName: string;
procedure RaiseStrConstExpected;
procedure RaiseStrConstExpected(id: int64);
public
// comments
function CleanPosIsInComment(CleanPos, CleanCodePosInFront: integer;
@ -364,9 +364,9 @@ end;
{ TPascalReaderTool }
procedure TPascalReaderTool.RaiseStrConstExpected;
procedure TPascalReaderTool.RaiseStrConstExpected(id: int64);
begin
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsStringConstant,GetAtom]);
RaiseExceptionFmt(id,ctsStrExpectedButAtomFound,[ctsStringConstant,GetAtom]);
end;
function TPascalReaderTool.CleanPosIsInComment(CleanPos,
@ -381,7 +381,7 @@ begin
CommentEnd:=0;
if CleanPos>SrcLen then exit;
if CleanCodePosInFront>CleanPos then
RaiseException(
RaiseException(20170421195949,
'TPascalReaderTool.CleanPosIsInComment CleanCodePosInFront>CleanPos');
MoveCursorToCleanPos(CleanCodePosInFront);
repeat
@ -525,7 +525,7 @@ begin
end;
if CurPos.Flag in [cafSemicolon,cafEND] then exit;
if not (CurPos.Flag=cafColon) then
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[':',GetAtom]);
RaiseExceptionFmt(20170421195952,ctsStrExpectedButAtomFound,[':',GetAtom]);
ReadNextAtom;
AtomIsIdentifierE;
if InUpperCase then
@ -1191,7 +1191,7 @@ begin
if (ProcNode<>nil) and (ProcNode.Desc in [ctnProcedureType,ctnProcedure]) then
ProcNode:=ProcNode.FirstChild;
if (ProcNode=nil) or (ProcNode.Desc<>ctnProcedureHead) then begin
RaiseException('Internal Error in'
RaiseException(20170421195956,'Internal Error in'
+' TPascalParserTool.MoveCursorFirstProcSpecifier: '
+' (ProcNode=nil) or (ProcNode.Desc<>ctnProcedure)');
end;
@ -1473,7 +1473,7 @@ begin
if ProcNode.Desc<>ctnProcedure then begin
DebugLn(['TPascalReaderTool.ProcNodeHasSpecifier Desc=',ProcNode.DescAsString]);
CTDumpStack;
RaiseException('[TPascalReaderTool.ProcNodeHasSpecifier] '
RaiseException(20170421195959,'[TPascalReaderTool.ProcNodeHasSpecifier] '
+'internal error: invalid ProcNode');
end;
{$ENDIF}
@ -2430,7 +2430,7 @@ function TPascalReaderTool.FindClassNodeInInterface(
procedure RaiseClassNotFound;
begin
RaiseExceptionFmt(ctsClassSNotFound, [AClassName]);
RaiseExceptionFmt(20170421200001,ctsClassSNotFound, [AClassName]);
end;
begin
@ -2455,7 +2455,7 @@ function TPascalReaderTool.FindClassNodeInUnit(const AClassName: string;
procedure RaiseClassNotFound;
begin
RaiseExceptionFmt(ctsClassSNotFound, [AClassName]);
RaiseExceptionFmt(20170421200003,ctsClassSNotFound, [AClassName]);
end;
begin
@ -3342,13 +3342,13 @@ begin
if (UsesNode=nil)
or ((UsesNode.Desc<>ctnUsesSection) and (UsesNode.Desc<>ctnContainsSection))
then
RaiseException('[TPascalParserTool.MoveCursorToUsesStart] '
RaiseException(20170421200006,'[TPascalParserTool.MoveCursorToUsesStart] '
+'internal error: invalid UsesNode');
// search through the uses section
MoveCursorToCleanPos(UsesNode.StartPos);
ReadNextAtom;
if (not UpAtomIs('USES')) and (not UpAtomIs('CONTAINS')) then
RaiseExceptionFmt(ctsStrExpectedButAtomFound,['uses',GetAtom]);
RaiseExceptionFmt(20170421200009,ctsStrExpectedButAtomFound,['uses',GetAtom]);
ReadNextAtom;
end;
@ -3357,13 +3357,13 @@ begin
if (UsesNode=nil)
or ((UsesNode.Desc<>ctnUsesSection) and (UsesNode.Desc<>ctnContainsSection))
then
RaiseException('[TPascalParserTool.MoveCursorToUsesEnd] '
RaiseException(20170421200012,'[TPascalParserTool.MoveCursorToUsesEnd] '
+'internal error: invalid UsesNode');
// search backwards through the uses section
MoveCursorToCleanPos(UsesNode.EndPos);
ReadPriorAtom; // read ';'
if not AtomIsChar(';') then
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[';',GetAtom]);
RaiseExceptionFmt(20170421200014,ctsStrExpectedButAtomFound,[';',GetAtom]);
end;
function TPascalReaderTool.ReadNextUsedUnit(out UnitNameRange,
@ -3384,7 +3384,7 @@ begin
ReadNextAtom; // read filename
if not AtomIsStringConstant then begin
if not SyntaxExceptions then exit;
RaiseStrConstExpected;
RaiseStrConstExpected(20170421200017);
end;
InAtom:=CurPos;
ReadNextAtom; // read comma or semicolon
@ -3401,7 +3401,7 @@ begin
InAtom:=CurPos;
ReadPriorAtom; // read 'in'
if not UpAtomIs('IN') then
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[ctsKeywordIn,GetAtom]);
RaiseExceptionFmt(20170421200021,ctsStrExpectedButAtomFound,[ctsKeywordIn,GetAtom]);
ReadPriorAtom; // read unitname
end else begin
InAtom:=CleanAtomPosition;

View File

@ -611,7 +611,7 @@ var
end else if CurPos.Flag=cafSemicolon then begin
break;
end else
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[';',GetAtom]);
RaiseExceptionFmt(20170421201056,ctsStrExpectedButAtomFound,[';',GetAtom]);
until false;
Result:=true;
end;
@ -981,7 +981,8 @@ begin
BuildTree(lsrImplementationUsesSectionEnd)
else if UsesSection=usImplementation then begin
MoveCursorToNodeStart(Tree.Root);
RaiseException('can not add a unit to the implementation, because only a unit has one');
RaiseException(20170421201102,
ctsCanNotAddAUnitToTheImplementationBecauseOnlyAUnitH);
end;
SourceChangeCache.MainScanner:=Scanner;
Beauty:=SourceChangeCache.BeautifyCodeOptions;
@ -1346,7 +1347,7 @@ function TStandardCodeTool.FindUsedUnitNames(var List: TStringToStringTree
end else if CurPos.Flag=cafSemicolon then begin
break;
end else
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[';',GetAtom]);
RaiseExceptionFmt(20170421201120,ctsStrExpectedButAtomFound,[';',GetAtom]);
until false;
Result:=true;
end;
@ -3316,7 +3317,7 @@ var
CurEndPos: LongInt;
begin
if StartPos>=EndPos then
RaiseException('TStandardCodeTool CommentCode');
RaiseException(20170421201123,'TStandardCodeTool CommentCode');
Result:=false;
// comment with curly brackets {}
@ -4506,13 +4507,13 @@ var ClassNode, SectionNode: TCodeTreeNode;
begin
Result:=nil;
if (AClassName='') or (length(AClassName)>255) then
RaiseException(Format(ctsinvalidClassName, [AClassName]));
RaiseExceptionFmt(20170421201129,ctsinvalidClassName, [AClassName]);
if AVarName='' then exit;
BuildTree(lsrImplementationStart);
ClassNode:=FindClassNodeInInterface(AClassName,true,false,false);
if ClassNode=nil then begin
if ExceptionOnClassNotFound then
RaiseException(Format(ctsclassNotFound, [AClassName]))
RaiseExceptionFmt(20170421201136,ctsclassNotFound, [AClassName])
else
exit;
end;
@ -4541,13 +4542,13 @@ var ClassNode, SectionNode: TCodeTreeNode;
begin
Result:=false;
if (AClassName='') or (length(AClassName)>255) then
RaiseException(Format(ctsinvalidClassName2, [AClassName]));
RaiseExceptionFmt(20170421201143,ctsinvalidClassName2, [AClassName]);
if (VarName='') or (length(VarName)>255) then
RaiseException(Format(ctsinvalidVariableName, [VarName]));
RaiseExceptionFmt(20170421201152,ctsinvalidVariableName, [VarName]);
if (VarType='') or (length(VarType)>255) then
RaiseException(Format(ctsinvalidVariableType, [VarType]));
RaiseExceptionFmt(20170421201158,ctsinvalidVariableType, [VarType]);
if (SourceChangeCache=nil) then
RaiseException('missing SourceChangeCache');
RaiseException(20170421201203,'missing SourceChangeCache');
if FindPublishedVariable(AClassName,VarName,true)<>nil then
begin
Result:=true;
@ -4555,7 +4556,7 @@ begin
end;
ClassNode:=FindClassNodeInInterface(AClassName,true,false,true);
if ClassNode=nil then
RaiseException(Format(ctsclassNotFound, [AClassName]));
RaiseExceptionFmt(20170421201208,ctsclassNotFound, [AClassName]);
SectionNode:=ClassNode.FirstChild;
if (SectionNode.NextBrother<>nil)
and (SectionNode.NextBrother.Desc=ctnClassPublished) then
@ -4643,7 +4644,7 @@ begin
if not SourceChangeCache.Replace(gtNone,gtNone,
CurPos.StartPos,CurPos.EndPos,VarType)
then begin
RaiseException('Unable to replace type');
RaiseException(20170421201215,'Unable to replace type');
end;
end;
// rename variable in source
@ -4731,7 +4732,7 @@ begin
Result:=false;
TreeOfCodeTreeNodeExtension:=nil;
if (TheClassName='') or (length(TheClassName)>255) then
RaiseException(Format(ctsInvalidClassName, [TheClassName]));
RaiseExceptionFmt(20170421201221,ctsInvalidClassName, [TheClassName]);
{$IFDEF VerboseDanglingComponentEvents}
DebugLn(['TStandardCodeTool.GatherPublishedClassElements BEFORE buildtree']);
{$ENDIF}
@ -4994,14 +4995,16 @@ begin
MoveCursorToCleanPos(Node.StartPos);
ReadNextAtom;
AtomIsIdentifierE;
if not ReadNextAtomIsChar(',') then RaiseCharExpectedButAtomFound(',');
if not ReadNextAtomIsChar(',') then
RaiseCharExpectedButAtomFound(20170421201227,',');
DeleteEndPos:=CurPos.EndPos;
end else if PrevSibling<>nil then begin
// var i, X: integer; -> var i[, X]: integer;
MoveCursorToCleanPos(PrevSibling.StartPos);
ReadNextAtom;
AtomIsIdentifierE;
if not ReadNextAtomIsChar(',') then RaiseCharExpectedButAtomFound(',');
if not ReadNextAtomIsChar(',') then
RaiseCharExpectedButAtomFound(20170421201233,',');
DeleteStartPos:=CurPos.StartPos;
end else begin
// delete whole declaration
@ -5089,7 +5092,7 @@ begin
Node:=FindDeepestNodeAtPos(CleanPos,true);
if not (Node.Desc in AllPascalStatements) then begin
MoveCursorToCleanPos(CleanPos);
RaiseException('invalid position for insertion of statements');
RaiseException(20170421201247,ctsInvalidPositionForInsertionOfStatements);
end;
if Node.Desc=ctnBeginBlock then
Node:=BuildSubTreeAndFindDeepestNodeAtPos(Node,CleanPos,true);
@ -5098,7 +5101,7 @@ begin
if (SameArea.StartPos>SrcLen) or (not IsSpaceChar[Src[SameArea.StartPos]])
then begin
MoveCursorToCleanPos(CleanPos);
RaiseException('invalid position for insertion of statements');
RaiseException(20170421201255,ctsInvalidPositionForInsertionOfStatements);
end;
SourceChangeCache.MainScanner:=Scanner;

View File

@ -10629,7 +10629,7 @@ begin
NewSource,NewX,NewY,NewTopLine, Interactive);
if (CodeToolBoss.ErrorMessage='')
and (CodeToolBoss.SourceChangeCache.BuffersToModifyCount=0) then
CodeToolBoss.SetError(nil,0,0,'there is no completion for this code');
CodeToolBoss.SetError(20170421203259,nil,0,0,'there is no completion for this code');
ApplyCodeToolChanges;
if (CodeToolBoss.ErrorMessage='') and (NewSource<>nil) then
DoJumpToCodePosition(ActiveSrcEdit, ActiveUnitInfo,

View File

@ -10097,7 +10097,8 @@ begin
JumpToPos(NewPos.Code.Filename, NewPos, NewTopLine)
else
begin
CodeToolBoss.SetError(nil, 0, 0, Format(lisCannotFind, [cJumpNames[JumpType]]));
CodeToolBoss.SetError(20170421203224, nil, 0, 0,
Format(lisCannotFind, [cJumpNames[JumpType]]));
LazarusIDE.DoJumpToCodeToolBossError;
end;
end
@ -10160,7 +10161,8 @@ begin
JumpToPos(NewCodePos.Code.Filename, NewCodePos, NewTopLine)
else
begin
CodeToolBoss.SetError(nil, 0, 0, Format(lisCannotFind, [cJumpNames[JumpType]]));
CodeToolBoss.SetError(20170421203236, nil, 0, 0,
Format(lisCannotFind, [cJumpNames[JumpType]]));
LazarusIDE.DoJumpToCodeToolBossError;
end;
end

View File

@ -7247,7 +7247,7 @@ begin
// show codetool error
if (CTErrorMsg<>'') and (not Quiet) then begin
CodeToolBoss.SetError(CTErrorCode,CTErrorLine,CTErrorCol,CTErrorMsg);
CodeToolBoss.SetError(20170421203251,CTErrorCode,CTErrorLine,CTErrorCol,CTErrorMsg);
MainIDE.DoJumpToCodeToolBossError;
Result:=mrAbort;
exit;