mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 20:26:13 +02:00
codetools: auto indent: edged brackets
git-svn-id: trunk@22315 -
This commit is contained in:
parent
5cde48e398
commit
50a2f313be
@ -105,6 +105,7 @@ type
|
||||
bbtClassInterface,
|
||||
bbtClassSection, // public, private, protected, published
|
||||
bbtTypeRoundBracket,
|
||||
bbtTypeEdgedBracket,
|
||||
// statement blocks
|
||||
bbtProcedure, // procedure, constructor, destructor
|
||||
bbtFunction,
|
||||
@ -125,7 +126,8 @@ type
|
||||
bbtIfThen, // child of bbtIf
|
||||
bbtIfElse, // child of bbtIf
|
||||
bbtIfBegin, // child of bbtIfThen or bbtIfElse
|
||||
bbtStatementRoundBracket
|
||||
bbtStatementRoundBracket,
|
||||
bbtStatementEdgedBracket
|
||||
);
|
||||
TFABBlockTypes = set of TFABBlockType;
|
||||
|
||||
@ -137,7 +139,8 @@ const
|
||||
bbtAllStatements = [bbtMainBegin,bbtFreeBegin,bbtRepeat,bbtProcedureBegin,
|
||||
bbtCaseColon,bbtCaseBegin,bbtCaseElse,
|
||||
bbtTry,bbtFinally,bbtExcept,
|
||||
bbtIfThen,bbtIfElse,bbtIfBegin,bbtStatementRoundBracket];
|
||||
bbtIfThen,bbtIfElse,bbtIfBegin,
|
||||
bbtStatementRoundBracket,bbtStatementEdgedBracket];
|
||||
const
|
||||
FABBlockTypeNames: array[TFABBlockType] of string = (
|
||||
'bbtNone',
|
||||
@ -159,6 +162,7 @@ const
|
||||
'bbtClassInterface',
|
||||
'bbtClassSection',
|
||||
'bbtTypeRoundBracket',
|
||||
'bbtTypeEdgedBracket',
|
||||
// statement blocks
|
||||
'bbtProcedure',
|
||||
'bbtFunction',
|
||||
@ -179,7 +183,8 @@ const
|
||||
'bbtIfThen',
|
||||
'bbtIfElse',
|
||||
'bbtIfBegin',
|
||||
'bbtStatementRoundBracket'
|
||||
'bbtStatementRoundBracket',
|
||||
'bbtStatementEdgedBracket'
|
||||
);
|
||||
|
||||
type
|
||||
@ -585,6 +590,22 @@ begin
|
||||
BeginBlock(bbtTypeRoundBracket);
|
||||
end;
|
||||
end;
|
||||
']':
|
||||
if p-AtomStart=1 then begin
|
||||
// edged bracket close
|
||||
case Stack.TopType of
|
||||
bbtTypeEdgedBracket,bbtStatementEdgedBracket:
|
||||
EndBlock;
|
||||
end;
|
||||
end;
|
||||
'[':
|
||||
if p-AtomStart=1 then begin
|
||||
// edged bracket open
|
||||
if Stack.TopType in bbtAllStatements then
|
||||
BeginBlock(bbtStatementEdgedBracket)
|
||||
else
|
||||
BeginBlock(bbtTypeEdgedBracket);
|
||||
end;
|
||||
')':
|
||||
if p-AtomStart=1 then begin
|
||||
// round bracket close
|
||||
|
Loading…
Reference in New Issue
Block a user