mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 23:19:50 +02:00
synedit: extend a list of places where procedure modifiers are allowed, restrict 'pascal', 'register' and 'safecall' modifiers to that places
git-svn-id: trunk@23345 -
This commit is contained in:
parent
aab393226c
commit
1887ef1c98
@ -128,7 +128,8 @@ const
|
|||||||
// restrict cdecl etc to places where they can be.
|
// restrict cdecl etc to places where they can be.
|
||||||
// this needs a better parser
|
// this needs a better parser
|
||||||
ProcModifierAllowed: TPascalCodeFoldBlockTypes =
|
ProcModifierAllowed: TPascalCodeFoldBlockTypes =
|
||||||
[cfbtNone, cfbtProcedure, cfbtProgram, cfbtClassSection, cfbtUnitSection]; // unitsection, actually interface only
|
[cfbtNone, cfbtProcedure, cfbtProgram, cfbtClassSection, cfbtUnitSection, // unitsection, actually interface only
|
||||||
|
cfbtVarType, cfbtLocalVarType];
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -1109,8 +1110,13 @@ end;
|
|||||||
|
|
||||||
function TSynPasSyn.Func52: TtkTokenKind;
|
function TSynPasSyn.Func52: TtkTokenKind;
|
||||||
begin
|
begin
|
||||||
if KeyComp('Pascal') then Result := tkKey
|
if KeyComp('Pascal') and (TopPascalCodeFoldBlockType in ProcModifierAllowed) then
|
||||||
else if KeyComp('Raise') then Result := tkKey else Result := tkIdentifier;
|
Result := tkKey
|
||||||
|
else
|
||||||
|
if KeyComp('Raise') then
|
||||||
|
Result := tkKey
|
||||||
|
else
|
||||||
|
Result := tkIdentifier;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynPasSyn.Func54: TtkTokenKind;
|
function TSynPasSyn.Func54: TtkTokenKind;
|
||||||
@ -1157,7 +1163,10 @@ end;
|
|||||||
|
|
||||||
function TSynPasSyn.Func59: TtkTokenKind;
|
function TSynPasSyn.Func59: TtkTokenKind;
|
||||||
begin
|
begin
|
||||||
if KeyComp('Safecall') then Result := tkKey else Result := tkIdentifier;
|
if KeyComp('Safecall') and (TopPascalCodeFoldBlockType in ProcModifierAllowed) then
|
||||||
|
Result := tkKey
|
||||||
|
else
|
||||||
|
Result := tkIdentifier;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynPasSyn.Func60: TtkTokenKind;
|
function TSynPasSyn.Func60: TtkTokenKind;
|
||||||
@ -1591,7 +1600,7 @@ end;
|
|||||||
|
|
||||||
function TSynPasSyn.Func101: TtkTokenKind;
|
function TSynPasSyn.Func101: TtkTokenKind;
|
||||||
begin
|
begin
|
||||||
if KeyComp('Register') then
|
if KeyComp('Register') and (TopPascalCodeFoldBlockType in ProcModifierAllowed) then
|
||||||
Result := tkKey
|
Result := tkKey
|
||||||
else
|
else
|
||||||
if KeyComp('Platform') then
|
if KeyComp('Platform') then
|
||||||
|
Loading…
Reference in New Issue
Block a user