codetools: added AnsiChar

This commit is contained in:
mattias 2023-08-22 16:09:33 +02:00
parent 2234c02716
commit 5763fb14c6
2 changed files with 12 additions and 4 deletions

View File

@ -232,6 +232,7 @@ type
xtNone, // undefined xtNone, // undefined
xtContext, // a node xtContext, // a node
xtChar, // char xtChar, // char
xtAnsiChar, // ansichar
xtWideChar, // widechar xtWideChar, // widechar
xtReal, // real xtReal, // real
xtSingle, // single xtSingle, // single
@ -288,6 +289,7 @@ var
'None', 'None',
'Context', 'Context',
'Char', 'Char',
'AnsiChar',
'WideChar', 'WideChar',
'Real', 'Real',
'Single', 'Single',
@ -357,7 +359,7 @@ const
xtAllPointerTypes = [xtPointer, xtNil]; xtAllPointerTypes = [xtPointer, xtNil];
xtAllTypeHelperTypes = xtAllPredefinedTypes-[xtCompilerFunc,xtVariant,xtJSValue,xtNil]; xtAllTypeHelperTypes = xtAllPredefinedTypes-[xtCompilerFunc,xtVariant,xtJSValue,xtNil];
xtAllStringCompatibleTypes = xtAllStringTypes+[xtChar,xtJSValue]; xtAllStringCompatibleTypes = xtAllStringTypes+[xtChar,xtAnsiChar,xtJSValue];
xtAllWideStringCompatibleTypes = xtAllWideStringTypes+[xtWideChar,xtChar]; xtAllWideStringCompatibleTypes = xtAllWideStringTypes+[xtWideChar,xtChar];
xtAllIntegerConvertibles = xtAllIntegerTypes; xtAllIntegerConvertibles = xtAllIntegerTypes;
@ -1252,7 +1254,7 @@ function StringTypesOrderList: TTypeAliasOrderList;
begin begin
if FStringTypesOrderList=nil then if FStringTypesOrderList=nil then
FStringTypesOrderList:=TTypeAliasOrderList.Create([ FStringTypesOrderList:=TTypeAliasOrderList.Create([
'string', 'AnsiString', 'WideString', 'ShortString', 'Char', 'WideChar', 'AnsiChar']); 'string', 'AnsiString', 'WideString', 'ShortString', 'Char', 'AnsiChar', 'WideChar']);
Result := FStringTypesOrderList; Result := FStringTypesOrderList;
end; end;
@ -1335,8 +1337,10 @@ begin
Result:=xtBoolean32 Result:=xtBoolean32
else if CompareIdentifiers(Identifier,'BOOLEAN64')=0 then else if CompareIdentifiers(Identifier,'BOOLEAN64')=0 then
Result:=xtBoolean64 Result:=xtBoolean64
else if CompareIdentifiers(Identifier,'CHAR')=0 then else if (CompareIdentifiers(Identifier,'CHAR')=0) then
Result:=xtChar Result:=xtChar
else if (CompareIdentifiers(Identifier,'ANSICHAR')=0) then
Result:=xtAnsiChar
else if CompareIdentifiers(Identifier,'WIDECHAR')=0 then else if CompareIdentifiers(Identifier,'WIDECHAR')=0 then
Result:=xtWideChar Result:=xtWideChar
else if CompareIdentifiers(Identifier,'REAL')=0 then else if CompareIdentifiers(Identifier,'REAL')=0 then
@ -10801,7 +10805,7 @@ begin
then begin then begin
Result.SubDesc:=Result.Desc; Result.SubDesc:=Result.Desc;
Result.Desc:=xtPointer; Result.Desc:=xtPointer;
end else if (Result.Desc=xtChar) then begin end else if (Result.Desc in [xtChar,xtAnsiChar]) then begin
Result.SubDesc:=xtNone; Result.SubDesc:=xtNone;
Result.Desc:=xtPChar Result.Desc:=xtPChar
end else begin end else begin
@ -13080,6 +13084,7 @@ function TFindDeclarationTool.FindForInTypeAsString(TermPos: TAtomPosition;
end; end;
end; end;
xtChar, xtChar,
xtAnsiChar,
xtSmallInt, xtSmallInt,
xtShortInt, xtShortInt,
xtByte, xtByte,
@ -13844,6 +13849,7 @@ begin
end; end;
xtChar, xtChar,
xtAnsiChar,
xtWideChar, xtWideChar,
xtReal, xtReal,
xtSingle, xtSingle,
@ -13862,6 +13868,7 @@ begin
begin begin
case ExprType.SubDesc of case ExprType.SubDesc of
xtChar, xtChar,
xtAnsiChar,
xtWideChar, xtWideChar,
xtReal, xtReal,
xtSingle, xtSingle,

View File

@ -1771,6 +1771,7 @@ begin
KeyWordLists.Add(WordIsPredefinedFPCIdentifier); KeyWordLists.Add(WordIsPredefinedFPCIdentifier);
with WordIsPredefinedFPCIdentifier do begin with WordIsPredefinedFPCIdentifier do begin
// types // types
Add('ANSICHAR' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('ANSISTRING' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('ANSISTRING' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('BOOLEAN' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('BOOLEAN' ,{$ifdef FPC}@{$endif}AllwaysTrue);
Add('BOOLEAN8' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('BOOLEAN8' ,{$ifdef FPC}@{$endif}AllwaysTrue);