Witam,
mam problem - korzystam z komponentów SynEdit, między innymi z SynHighlighterPHP. Problemem jest to, że nie ma niektórych słów, które chciałbym podświetlać jako Keywords (tak jak function, chodzi mi o m.in. private, public, protected, abstract, final, implements, interface).
Czy istnieje jakiś sposób, aby dodać te słowa do tego komponentu?
Próbowałem do Source\SynHighlighterPHP.pas dodać:
function Func111: TtkTokenKind;
function Func112: TtkTokenKind;
function Func113: TtkTokenKind;
function Func114: TtkTokenKind;
function Func115: TtkTokenKind;
...
fIdentFuncTable[111] := Func111;
fIdentFuncTable[112] := Func112;
fIdentFuncTable[113] := Func113;
fIdentFuncTable[114] := Func114;
fIdentFuncTable[115] := Func115;
...
function TSynPHPSyn.Func111: TtkTokenKind;
begin
if KeyComp('abstract') then Result := tkKey else Result := tkIdentifier;
end;
function TSynPHPSyn.Func112: TtkTokenKind;
begin
if KeyComp('final') then Result := tkKey else Result := tkIdentifier;
end;
function TSynPHPSyn.Func113: TtkTokenKind;
begin
if KeyComp('implements') then Result := tkKey else Result := tkIdentifier;
end;
function TSynPHPSyn.Func114: TtkTokenKind;
begin
if KeyComp('public') then Result := tkKey else Result := tkIdentifier;
end;
function TSynPHPSyn.Func115: TtkTokenKind;
begin
if KeyComp('private') then Result := tkKey else Result := tkIdentifier;
end;
I przekompilować na nowo, ale nie odnosi to żadnego skutku.