mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:39:21 +02:00
fixed FindEndOfExpression for bogus statements
git-svn-id: trunk@5352 -
This commit is contained in:
parent
2005490239
commit
82ad9e0e7d
@ -625,7 +625,7 @@ begin
|
||||
TermAtom.StartPos:=CurPos.StartPos;
|
||||
TermAtom.EndPos:=FindEndOfExpression(TermAtom.StartPos);
|
||||
|
||||
Result:=true;
|
||||
Result:=TermAtom.EndPos>TermAtom.StartPos;
|
||||
end;
|
||||
|
||||
function TCodeCompletionCodeTool.AddLocalVariable(
|
||||
@ -755,7 +755,8 @@ begin
|
||||
end;
|
||||
|
||||
{$IFDEF CTDEBUG}
|
||||
writeln(' CompleteLocalVariableAssignment: Find type of term... ');
|
||||
writeln(' CompleteLocalVariableAssignment: Find type of term ...',
|
||||
' Term="',copy(Src,TermAtom.StartPos,TermAtom.EndPos-TermAtom.StartPos),'"');
|
||||
{$ENDIF}
|
||||
// find type of term
|
||||
NewType:=FindTermTypeAsString(TermAtom,CursorNode,Params);
|
||||
|
@ -929,7 +929,9 @@ begin
|
||||
while (CurPos.EndPos<=SrcLen) and (IsNumberChar[Src[CurPos.EndPos]]) do
|
||||
inc(CurPos.EndPos);
|
||||
if (CurPos.EndPos<SrcLen)
|
||||
and (Src[CurPos.EndPos]='.') and (Src[CurPos.EndPos+1]<>'.') then begin
|
||||
and (Src[CurPos.EndPos]='.')
|
||||
and (IsAfterFloatPointChar[Src[CurPos.EndPos+1]])
|
||||
then begin
|
||||
// real type number
|
||||
inc(CurPos.EndPos);
|
||||
while (CurPos.EndPos<=SrcLen) and (IsNumberChar[Src[CurPos.EndPos]])
|
||||
|
@ -3195,8 +3195,9 @@ var
|
||||
OldFlags: TFindDeclarationFlags;
|
||||
begin
|
||||
{$IFDEF ShowExprEval}
|
||||
writeln('[TFindDeclarationTool.FindExpressionResultType] Start ',
|
||||
'"',copy(Src,StartPos,EndPos-StartPos),'" Context=',Params.ContextNode.DescAsString);
|
||||
writeln('[TFindDeclarationTool.FindExpressionResultType] Start',
|
||||
' Pos=',StartPos,'-',EndPos,
|
||||
'="',copy(Src,StartPos,EndPos-StartPos),'" Context=',Params.ContextNode.DescAsString);
|
||||
{$ENDIF}
|
||||
Result:=CleanExpressionType;
|
||||
OldFlags:=Params.Flags;
|
||||
@ -4417,8 +4418,9 @@ begin
|
||||
repeat
|
||||
ReadNextAtom;
|
||||
// read till statement end
|
||||
if (CurPos.Flag in [cafSemicolon,cafComma,cafEnd,cafNone,
|
||||
cafRoundBracketClose,cafEdgedBracketClose])
|
||||
if (CurPos.StartPos>SrcLen)
|
||||
or (CurPos.Flag in [cafSemicolon,cafComma,cafEnd,
|
||||
cafRoundBracketClose,cafEdgedBracketClose])
|
||||
or (AtomIsKeyWord
|
||||
and not IsKeyWordInConstAllowed.DoItUpperCase(UpperSrc,
|
||||
CurPos.StartPos,CurPos.EndPos-CurPos.StartPos))
|
||||
@ -6130,7 +6132,7 @@ begin
|
||||
Params.Flags:=[fdfSearchInParentNodes,fdfSearchInAncestors,
|
||||
fdfTopLvlResolving,fdfFunctionResult];
|
||||
ExprType:=FindExpressionResultType(Params,TermAtom.StartPos,TermAtom.EndPos);
|
||||
{$IFDEF CTDEBUG}
|
||||
{$IFDEF ShowExprEval}
|
||||
writeln('TFindDeclarationTool.FindTermTypeAsString ExprTypeToString=',
|
||||
ExprTypeToString(ExprType));
|
||||
{$ENDIF}
|
||||
|
@ -454,7 +454,7 @@ var
|
||||
|
||||
IsSpaceChar, IsLineEndChar, IsWordChar, IsIdentStartChar, IsIdentChar,
|
||||
IsNumberChar, IsCommentStartChar, IsCommentEndChar, IsHexNumberChar,
|
||||
IsEqualOperatorStartChar:
|
||||
IsEqualOperatorStartChar, IsAfterFloatPointChar:
|
||||
array[char] of boolean;
|
||||
|
||||
PSourceLinkMemManager: TPSourceLinkMemManager;
|
||||
@ -3117,6 +3117,7 @@ begin
|
||||
IsHexNumberChar[c]:=c in ['0'..'9','a'..'f','A'..'F'];
|
||||
IsEqualOperatorStartChar[c]:=c in [':','+','-','/','*','<','>'];
|
||||
IsWordChar[c]:=c in ['a'..'z','A'..'Z'];
|
||||
IsAfterFloatPointChar[c]:=c in ['0'..'9','e','E'];
|
||||
end;
|
||||
for CompMode:=Low(TCompilerMode) to High(TCompilerMode) do
|
||||
CompilerModeVars[CompMode]:='FPC_'+CompilerModeNames[CompMode];
|
||||
|
@ -35,8 +35,8 @@
|
||||
need sort category to listbox
|
||||
- sometimes click in listbox causes selecting last item
|
||||
(it's an strange gtk error. The LCL and the gtk intf do not send any
|
||||
change. Either it is a bug in the gtk1 or we are doing something
|
||||
wrong in the handlers.)
|
||||
change to the gtk. Either it is a bug in the gtk1 or we are doing
|
||||
something wrong in the handlers.)
|
||||
}
|
||||
|
||||
|
||||
|
@ -534,8 +534,8 @@ begin
|
||||
SrcLineEndPosition);
|
||||
GetRawImageXYPosition(DestRawImageDesc,DestLineStarts,0,y,
|
||||
DestLineStartPosition);
|
||||
//writeln('ExtractRawImageDataRect A y=',y,' SrcByte=',SrcLineStartPosition.Byte,' SrcBit=',SrcLineStartPosition.Bit,
|
||||
//' DestByte=',DestLineStartPosition.Byte,' DestBit=',DestLineStartPosition.Bit);
|
||||
writeln('ExtractRawImageDataRect A y=',y,' SrcByte=',SrcLineStartPosition.Byte,' SrcBit=',SrcLineStartPosition.Bit,
|
||||
' DestByte=',DestLineStartPosition.Byte,' DestBit=',DestLineStartPosition.Bit);
|
||||
if (SrcLineStartPosition.Bit=0)
|
||||
and (DestLineStartPosition.Bit=0) then begin
|
||||
// copy bytes
|
||||
@ -549,7 +549,7 @@ begin
|
||||
ByteCount);
|
||||
end else if (DestLineStartPosition.Bit=0) then begin
|
||||
// copy and move bits
|
||||
ByteCount:=(SrcWidth*BitsPerPixel+7) shr 3;
|
||||
ByteCount:=((SrcWidth*BitsPerPixel)+7) shr 3;
|
||||
Shift:=8-SrcLineStartPosition.Bit;
|
||||
SrcPos:=PByte(Cardinal(SrcData)+SrcLineStartPosition.Byte);
|
||||
DestPos:=PByte(Cardinal(DestData)+DestLineStartPosition.Byte);
|
||||
@ -767,6 +767,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.29 2004/03/30 17:45:31 mattias
|
||||
fixed FindEndOfExpression for bogus statements
|
||||
|
||||
Revision 1.28 2004/03/28 12:49:22 mattias
|
||||
implemented mask merge and extraction for raw images
|
||||
|
||||
|
@ -814,6 +814,7 @@ procedure TCustomImageList.ReadData(AStream: TStream);
|
||||
BeginUpdate;
|
||||
IntfImage.GetRawImage(RawImage);
|
||||
FillChar(SubRawImage,SizeOf(SubRawImage),0);
|
||||
//NewCount:=2;
|
||||
try
|
||||
for Row := 0 to (IntfImage.Height div Height) - 1 do
|
||||
begin
|
||||
@ -1181,6 +1182,9 @@ end;
|
||||
{
|
||||
|
||||
$Log$
|
||||
Revision 1.35 2004/03/30 17:45:31 mattias
|
||||
fixed FindEndOfExpression for bogus statements
|
||||
|
||||
Revision 1.34 2004/03/29 17:21:52 mattias
|
||||
actionslist editor improved from Radek
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user