mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 00:02:03 +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.
|
||||
// this needs a better parser
|
||||
ProcModifierAllowed: TPascalCodeFoldBlockTypes =
|
||||
[cfbtNone, cfbtProcedure, cfbtProgram, cfbtClassSection, cfbtUnitSection]; // unitsection, actually interface only
|
||||
[cfbtNone, cfbtProcedure, cfbtProgram, cfbtClassSection, cfbtUnitSection, // unitsection, actually interface only
|
||||
cfbtVarType, cfbtLocalVarType];
|
||||
|
||||
type
|
||||
|
||||
@ -1109,8 +1110,13 @@ end;
|
||||
|
||||
function TSynPasSyn.Func52: TtkTokenKind;
|
||||
begin
|
||||
if KeyComp('Pascal') then Result := tkKey
|
||||
else if KeyComp('Raise') then Result := tkKey else Result := tkIdentifier;
|
||||
if KeyComp('Pascal') and (TopPascalCodeFoldBlockType in ProcModifierAllowed) then
|
||||
Result := tkKey
|
||||
else
|
||||
if KeyComp('Raise') then
|
||||
Result := tkKey
|
||||
else
|
||||
Result := tkIdentifier;
|
||||
end;
|
||||
|
||||
function TSynPasSyn.Func54: TtkTokenKind;
|
||||
@ -1157,7 +1163,10 @@ end;
|
||||
|
||||
function TSynPasSyn.Func59: TtkTokenKind;
|
||||
begin
|
||||
if KeyComp('Safecall') then Result := tkKey else Result := tkIdentifier;
|
||||
if KeyComp('Safecall') and (TopPascalCodeFoldBlockType in ProcModifierAllowed) then
|
||||
Result := tkKey
|
||||
else
|
||||
Result := tkIdentifier;
|
||||
end;
|
||||
|
||||
function TSynPasSyn.Func60: TtkTokenKind;
|
||||
@ -1591,7 +1600,7 @@ end;
|
||||
|
||||
function TSynPasSyn.Func101: TtkTokenKind;
|
||||
begin
|
||||
if KeyComp('Register') then
|
||||
if KeyComp('Register') and (TopPascalCodeFoldBlockType in ProcModifierAllowed) then
|
||||
Result := tkKey
|
||||
else
|
||||
if KeyComp('Platform') then
|
||||
|
Loading…
Reference in New Issue
Block a user