codetools: clean up

git-svn-id: trunk@20317 -
This commit is contained in:
mattias 2009-05-30 17:34:18 +00:00
parent 66278c69d1
commit c7b2a8b99e
2 changed files with 33 additions and 9 deletions

View File

@ -125,6 +125,8 @@ type
Step: integer; // starting at 0
out CodeBuffers: TFPList // stopping when CodeBuffers=nil
) of object;
TOnGetFABNestedComments = procedure(Sender: TObject; Code: TCodeBuffer;
out NestedComments) of object;
TFABIndentationPolicy = record
Indent: integer;
@ -177,6 +179,7 @@ type
private
FOnGetExamples: TOnGetFABExamples;
FCodePolicies: TAVLTree;// tree of TFABPolicies sorted for Code
FOnGetNestedComments: TOnGetFABNestedComments;
procedure ParseSource(const Src: string; StartPos, EndPos: integer;
NestedComments: boolean;
Stack: TFABBlockStack; Policies: TFABPolicies);
@ -197,7 +200,10 @@ type
- learn from sources
- learn from nearest lines in source
}
property OnGetExamples: TOnGetFABExamples read FOnGetExamples write FOnGetExamples;
property OnGetExamples: TOnGetFABExamples read FOnGetExamples
write FOnGetExamples;
property OnGetNestedComments: TOnGetFABNestedComments
read FOnGetNestedComments write FOnGetNestedComments;
end;
const
@ -795,6 +801,8 @@ function TFullyAutomaticBeautifier.GetNestedCommentsForCode(Code: TCodeBuffer
): boolean;
begin
Result:=true;
if Assigned(OnGetNestedComments) then
OnGetNestedComments(Self,Code,Result);
end;
constructor TFullyAutomaticBeautifier.Create;

View File

@ -112,7 +112,7 @@ type
procedure EndComment(CommentStart: char; p: integer);
public
LineLength: integer;
LineEnd: string; // default: #13#10
LineEnd: string;
Indent: integer;
TabWidth: integer;
KeyWordPolicy: TWordPolicy;
@ -164,7 +164,7 @@ type
{ TSourceChangeCache }
//----------------------------------------------------------------------------
// in front of and after a text change can be set a gap.
// in front of and after a text change can a gap be set.
// A Gap is for example a space char or a newline. TSourceChangeLog will add
// the gap if it is not already in the code
TGapTyp = (gtNone, // no special gap
@ -259,10 +259,23 @@ type
const
AtomTypeNames: array[TAtomType] of shortstring = (
'None', 'Keyword', 'Identifier', 'Colon', 'Semicolon', 'Comma', 'Point',
'At', 'Number', 'StringConstant', 'NewLine', 'Space',
'CommentStart', 'DirectiveStart', 'CommentEnd',
'Symbol', 'Bracket'
'None',
'Keyword',
'Identifier',
'Colon',
'Semicolon',
'Comma',
'Point',
'At',
'Number',
'StringConstant',
'NewLine',
'Space',
'CommentStart',
'DirectiveStart',
'CommentEnd',
'Symbol',
'Bracket'
);
WordPolicyNames: array[TWordPolicy] of shortstring = (
@ -278,8 +291,11 @@ const
);
ForwardProcBodyInsertPolicyNames: array[TForwardProcBodyInsertPolicy] of
shortstring =
('Last', 'InFrontOfMethods', 'BehindMethods');
shortstring = (
'Last',
'InFrontOfMethods',
'BehindMethods'
);
UsesInsertPolicyNames: array[TUsesInsertPolicy] of shortstring = (
'First',