codetools: added example for begin begin end

git-svn-id: trunk@20456 -
This commit is contained in:
mattias 2009-06-05 18:12:53 +00:00
parent f86f672699
commit 6bf2f76a84
3 changed files with 24 additions and 0 deletions

1
.gitattributes vendored
View File

@ -168,6 +168,7 @@ components/codetools/examples/testscompleteblock/caseend1.inc svneol=native#text
components/codetools/examples/testscompleteblock/ifbegin1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/procedurebegin1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/procedurebeginend1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/procedurebeginifbegin1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/record1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/repeatifelse1.inc svneol=native#text/plain
components/codetools/examples/testscompleteblock/unit1.pas svneol=native#text/plain

View File

@ -0,0 +1,22 @@
{%MainUnit unit1.pas}
procedure Do1;
procedure BeginBlock(Typ: TFABBlockType);
var
ParentBlock: PBlock;
begin
if (Stack.Top>=0) then begin
ParentBlock:=@Stack.Stack[Stack.Top];
if (ParentBlock^.InnerStartPos=AtomStart)
and (Policies<>nil) then begin
Policies.AddIndent(ParentBlock^.Typ,Typ,ParentBlock^.InnerIdent);
end;
Stack.BeginBlock(Typ,AtomStart);
{$IFDEF ShowCodeBeautifierParser}
DebugLn([GetIndentStr(Stack.Top*2),'BeginBlock ',FABBlockTypeNames[Typ],' ',GetAtomString(@Src[AtomStart],NestedComments),' at ',PosToStr(p)]);
{$ENDIF}
end;
begin
end;

View File

@ -13,6 +13,7 @@ implementation
{$IFDEF procedurebegin} {$I procedurebegin1.inc} {$ENDIF}
{$IFDEF procedurebeginend} {$I procedurebeginend1.inc} {$ENDIF}
{$IFDEF procedurebeginifbegin} {$I procedurebeginifbegin1.inc} {$ENDIF}
{$IFDEF whilebegin} {$I whilebegin1.inc} {$ENDIF}