codetools: fixed some tests

This commit is contained in:
mattias 2022-06-17 17:35:23 +02:00
parent 6b9fd935b2
commit 66b36cd172
5 changed files with 11 additions and 8 deletions

View File

@ -1503,7 +1503,7 @@ var
'.':
if (not FoundFloat)
and (CurPos.StartPos>2)
and (LastChar in ['0'..'9'])
and (LastChar in ['0'..'9','e','E'])
and (Src[CurPos.StartPos-2] in ['0'..'9']) then
begin
// float

View File

@ -198,7 +198,7 @@ var i, l, l2: integer;
pSrc, pDest: PWord;
begin
l:=length(s);
SetLength(Result,l);
SetLength(Result{%H-},l);
if l>0 then begin
pDest:=PWord(@Result[1]);
pSrc:=PWord(@s[1]);
@ -853,6 +853,7 @@ begin
IsIdentChar[c]:=c in ['a'..'z','A'..'Z','_','0'..'9'];
IsDottedIdentChar[c]:=c in ['.','a'..'z','A'..'Z','_','0'..'9'];
IsNumberChar[c]:=c in ['0'..'9'];
IsNumberOrSepChar[c]:=c in ['0'..'9','_'];
IsCommentStartChar[c]:=c in ['/','{','('];
IsCommentEndChar[c]:=c in ['}',')',#13,#10];
IsHexNumberChar[c]:=c in ['0'..'9','a'..'f','A'..'F'];

View File

@ -2143,7 +2143,7 @@ begin
if not WordIsTermOperator.DoItCaseInsensitive(Src,CurPos.StartPos,
CurPos.EndPos-CurPos.StartPos)
then begin
// not a operator
// not an operator
break;
end;
// operator => read further

View File

@ -1076,7 +1076,8 @@ procedure TTestFindDeclaration.TestFindDeclaration_AnonymProc;
begin
StartProgram;
Add([
'{$mode objfpc}{$modeswitch closures}',
'{$mode objfpc}',
'{$modeswitch anonymousfunctions}',
'type',
' int = word;',
' TFunc = function(i: int): int;',
@ -1106,7 +1107,8 @@ procedure TTestFindDeclaration.TestFindDeclaration_AnonymProc_ExprDot;
begin
StartProgram;
Add([
'{$mode objfpc}{$modeswitch closures}',
'{$mode objfpc}',
'{$modeswitch anonymousfunctions}',
'type',
' int = word;',
' TFunc = function(i: int): int;',

View File

@ -526,7 +526,7 @@ procedure TTestPascalParser.TestParseProcAnoAssign;
begin
Add([
'program test1;',
'{$modeswitch closures}',
'{$modeswitch anonymousfunctions}',
'procedure DoIt;',
'begin',
' p:=procedure begin end;',
@ -550,7 +550,7 @@ begin
Add([
'program test1;',
'{$mode objfpc}',
'{$modeswitch closures}',
'{$modeswitch anonymousfunctions}',
'procedure DoIt;',
'begin',
' DoIt(procedure begin end);',
@ -574,7 +574,7 @@ begin
Add([
'program test1;',
'{$mode objfpc}',
'{$modeswitch closures}',
'{$modeswitch anonymousfunctions}',
'procedure DoIt;',
'begin',
' DoIt(',