mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 17:50:19 +02:00
codetools: started &keyword identifiers
git-svn-id: trunk@34428 -
This commit is contained in:
parent
180515f92a
commit
5d55835b0d
@ -1896,11 +1896,16 @@ begin
|
||||
while IsHexNumberChar[Src^] do
|
||||
inc(Src);
|
||||
end;
|
||||
'&': // octal constant
|
||||
'&': // octal constant or keyword as identifier (e.g. &label)
|
||||
begin
|
||||
inc(Src);
|
||||
while (Src^ in ['0'..'7']) do
|
||||
inc(Src);
|
||||
if Src^ in ['0'..'7'] then begin
|
||||
while Src^ in ['0'..'7'] do
|
||||
inc(Src);
|
||||
end else begin
|
||||
while IsIdentChar[Src^] do
|
||||
inc(Src);
|
||||
end;
|
||||
end;
|
||||
'{': // compiler directive
|
||||
begin
|
||||
@ -3892,7 +3897,13 @@ end;
|
||||
function GetIdentifier(Identifier: PChar): string;
|
||||
var len: integer;
|
||||
begin
|
||||
if (Identifier<>nil) and IsIdentStartChar[Identifier^] then begin
|
||||
if (Identifier=nil) then begin
|
||||
Result:='';
|
||||
exit;
|
||||
end;
|
||||
if (Identifier^='&') and (IsIdentChar[Identifier[1]]) then
|
||||
inc(Identifier);
|
||||
if IsIdentStartChar[Identifier^] then begin
|
||||
len:=0;
|
||||
while (IsIdentChar[Identifier[len]]) do inc(len);
|
||||
SetLength(Result,len);
|
||||
|
@ -1192,11 +1192,17 @@ begin
|
||||
inc(p);
|
||||
CurPos.EndPos:=p-PChar(Src)+1;
|
||||
end;
|
||||
'&': // octal number
|
||||
'&': // octal number or keyword as identifier
|
||||
begin
|
||||
inc(p);
|
||||
while p^ in ['0'..'7'] do
|
||||
inc(p);
|
||||
if p^ in ['0'..'7'] then begin
|
||||
while p^ in ['0'..'7'] do
|
||||
inc(p);
|
||||
end else if IsIdentChar[p^] then begin
|
||||
CurPos.Flag:=cafWord;
|
||||
while IsIdentChar[p^] do
|
||||
inc(p);
|
||||
end;
|
||||
CurPos.EndPos:=p-PChar(Src)+1;
|
||||
end;
|
||||
'$': // hex number
|
||||
|
Loading…
Reference in New Issue
Block a user