Debugger: changed default intrinsic prefic to ":" / require bracket if no prefix

This commit is contained in:
Martin 2022-09-08 23:19:54 +02:00
parent 8b861738e0
commit 659d6aec30
3 changed files with 18 additions and 6 deletions

View File

@ -49,7 +49,7 @@ type
TSeparatorType = (ppstComma);
TFpIntrinsicPrefix = (ipExclamation, ipColon, ipNoPrefix);
TFpIntrinsicPrefix = (ipColon, ipExclamation, ipNoPrefix);
TFpIntrinsicFunc = (ifErrorNotFound, ifLength, ifChildClass);
TFpPascalParserCallFunctionProc = function (AnExpressionPart: TFpPascalExpressionPart;
@ -1754,8 +1754,10 @@ var
i: Integer;
begin
Result := AParams.Count - 1 = ARequiredCount;
if not Result then
if not Result then begin
SetError('wrong argument count');
exit;
end;
for i := 1 to ARequiredCount do
if (AParams.Items[i] = nil) then begin
@ -1997,6 +1999,16 @@ var
AddIntrinsic(intr);
end;
function CheckOpenBracket: Boolean;
var
p: PChar;
begin
p := TokenEndPtr;
while p^ in [' ', #9, #10, #13] do
inc(p);
Result := p^ = '(';
end;
procedure AddIdentifier;
var
intr: TFpIntrinsicFunc;
@ -2033,7 +2045,7 @@ var
if (FIntrinsicPrefix = ipNoPrefix) then begin
intr := LookupIntrinsic(CurPtr, TokenEndPtr - CurPtr);
if intr <> ifErrorNotFound then begin
if (intr <> ifErrorNotFound) and CheckOpenBracket then begin
AddIntrinsic(intr);
exit;
end;

View File

@ -129,7 +129,7 @@ type
property MemLimits: TFpDebugDebuggerPropertiesMemLimits read FMemLimits write SetMemLimits;
property HandleDebugBreakInstruction: TFpInt3DebugBreakOptions read FHandleDebugBreakInstruction write FHandleDebugBreakInstruction default [dboIgnoreAll];
property IntrinsicPrefix: TFpIntrinsicPrefix read FIntrinsicPrefix write FIntrinsicPrefix default ipExclamation;
property IntrinsicPrefix: TFpIntrinsicPrefix read FIntrinsicPrefix write FIntrinsicPrefix default ipColon;
end;
@ -370,7 +370,7 @@ begin
{$endif windows}
FMemLimits := TFpDebugDebuggerPropertiesMemLimits.Create;
FHandleDebugBreakInstruction := [dboIgnoreAll];
FIntrinsicPrefix := ipExclamation;
FIntrinsicPrefix := ipColon;
end;
destructor TFpDebugDebuggerProperties.Destroy;

View File

@ -1472,7 +1472,7 @@ end;
procedure TTestWatches.TestWatchesIntrinsic;
const PREFIX = '!';
const PREFIX = ':';
type
TTestLoc = (tlAny, tlConst, tlParam, tlArrayWrap, tlPointer, tlPointerAny, tlClassConst, tlClassVar);