mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 06:38:06 +02:00
IdeDebugger: fix searching array-index in expression.
(cherry picked from commit f581d4f764
)
This commit is contained in:
parent
2c6dbb037a
commit
57f4185083
@ -324,6 +324,11 @@ begin
|
||||
if p^ in ['@', '.', '+', '-', '*', '/', '(', ',', '=', '<', '>', '#', '$', '%', '&', '!'] then begin
|
||||
MaybeBeforeArrayIdx := False; // after operator. A [1..5] would be a set of byte
|
||||
|
||||
if (p^ = '(') and (InArrayIdxBracket > 0) then begin
|
||||
inc(InRndBracket);
|
||||
MaybeBeforeArrayIdx := False;
|
||||
end
|
||||
else
|
||||
if (InArrayIdxBracket > 0) and (InSqrBracket = 0) and (InRndBracket = 0) then begin
|
||||
if (p^ = '.') and (p[1] = '.') then begin
|
||||
if FoundDotDot then
|
||||
@ -387,12 +392,6 @@ begin
|
||||
end
|
||||
|
||||
|
||||
else
|
||||
if (p^ = '(') and (InArrayIdxBracket > 0) then begin
|
||||
inc(InRndBracket);
|
||||
MaybeBeforeArrayIdx := False;
|
||||
end
|
||||
|
||||
else
|
||||
if (p^ = '[') then begin
|
||||
if (not MaybeBeforeArrayIdx) then begin
|
||||
|
@ -74,6 +74,8 @@ begin
|
||||
Test('e1 in [x[1..15]]', 11, 'e1 in [x[11]]');
|
||||
Test('e1 in [x[1..15]..x[33..35]]', 11, 'e1 in [x[11]..x[33..35]]');
|
||||
|
||||
Test('PFoo((TList(FData).FList)^[0..TList(FData).FCount-1].FObject)^', 11, 'PFoo((TList(FData).FList)^[11].FObject)^');
|
||||
Test('PFoo((TList(FData).FList)^[-1..TList(FData).FCount-1].FObject)^', 11, 'PFoo((TList(FData).FList)^[11].FObject)^');
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
Loading…
Reference in New Issue
Block a user