mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-27 06:28:24 +02:00
Codetools: Support method names escaped with '&' in class completion. Issue #28227, patch from Ondrej Pokorny.
git-svn-id: trunk@49308 -
This commit is contained in:
parent
9dc2acfa82
commit
04f6320077
@ -833,7 +833,7 @@ begin
|
|||||||
if CurPos.StartPos>SrcLen then exit(false);
|
if CurPos.StartPos>SrcLen then exit(false);
|
||||||
p:=@Src[CurPos.StartPos];
|
p:=@Src[CurPos.StartPos];
|
||||||
if p^ in ['0'..'9','%','$'] then exit(true);
|
if p^ in ['0'..'9','%','$'] then exit(true);
|
||||||
if (p^='&') and (p[1] in ['0'..'7']) then exit(true);
|
if (p^='&') and IsOctNumberChar[p[1]] then exit(true);
|
||||||
Result:=false;
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1229,10 +1229,10 @@ begin
|
|||||||
'&': // octal number or keyword as identifier
|
'&': // octal number or keyword as identifier
|
||||||
begin
|
begin
|
||||||
inc(p);
|
inc(p);
|
||||||
if p^ in ['0'..'7'] then begin
|
if IsOctNumberChar[p^] then begin
|
||||||
while p^ in ['0'..'7'] do
|
while IsOctNumberChar[p^] do
|
||||||
inc(p);
|
inc(p);
|
||||||
end else if IsIdentChar[p^] then begin
|
end else if IsIdentStartChar[p^] then begin
|
||||||
CurPos.Flag:=cafWord;
|
CurPos.Flag:=cafWord;
|
||||||
while IsIdentChar[p^] do
|
while IsIdentChar[p^] do
|
||||||
inc(p);
|
inc(p);
|
||||||
|
@ -5170,7 +5170,7 @@ begin
|
|||||||
// -> check if a space must be inserted
|
// -> check if a space must be inserted
|
||||||
if AddAtom
|
if AddAtom
|
||||||
and ( ((phpCommentsToSpace in Attr) and (CurPos.StartPos>LastAtomEndPos))
|
and ( ((phpCommentsToSpace in Attr) and (CurPos.StartPos>LastAtomEndPos))
|
||||||
or ((CurPos.StartPos<=SrcLen) and (IsIdentChar[Src[CurPos.StartPos]])
|
or ((CurPos.StartPos<=SrcLen) and (IsIdentChar[Src[CurPos.StartPos]] or (Src[CurPos.StartPos] = '&'))
|
||||||
and ExtractStreamEndIsIdentChar)
|
and ExtractStreamEndIsIdentChar)
|
||||||
)
|
)
|
||||||
then begin
|
then begin
|
||||||
|
@ -1381,6 +1381,28 @@ begin
|
|||||||
then
|
then
|
||||||
CurAtomType:=atKeyword;
|
CurAtomType:=atKeyword;
|
||||||
end;
|
end;
|
||||||
|
'&': //identifier prefixed with '&' or octal number
|
||||||
|
begin
|
||||||
|
inc(CurPos);
|
||||||
|
if CurPos<=SrcLen then
|
||||||
|
case Src[CurPos] of
|
||||||
|
'a'..'z','A'..'Z','_'://identifier prefixed with '&'
|
||||||
|
begin
|
||||||
|
CurAtomType:=atIdentifier;
|
||||||
|
repeat
|
||||||
|
inc(CurPos);
|
||||||
|
until (CurPos>SrcLen) or (not IsIdentChar[Src[CurPos]]);
|
||||||
|
end;
|
||||||
|
'0'..'7'://octal number
|
||||||
|
begin
|
||||||
|
CurAtomType:=atNumber;
|
||||||
|
repeat
|
||||||
|
inc(CurPos);
|
||||||
|
until (CurPos>SrcLen) or (not IsOctNumberChar[Src[CurPos]]);
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
CurAtomType:=atNone;
|
||||||
|
end;
|
||||||
#128..#255: // UTF8
|
#128..#255: // UTF8
|
||||||
begin
|
begin
|
||||||
CurAtomType:=atIdentifier;
|
CurAtomType:=atIdentifier;
|
||||||
|
Loading…
Reference in New Issue
Block a user