From 6bf2f76a8474c0c9086d21f8e1f2f2d6a11a0d9a Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 5 Jun 2009 18:12:53 +0000 Subject: [PATCH] codetools: added example for begin begin end git-svn-id: trunk@20456 - --- .gitattributes | 1 + .../procedurebeginifbegin1.inc | 22 +++++++++++++++++++ .../examples/testscompleteblock/unit1.pas | 1 + 3 files changed, 24 insertions(+) create mode 100644 components/codetools/examples/testscompleteblock/procedurebeginifbegin1.inc diff --git a/.gitattributes b/.gitattributes index eb197bf560..3bd03beacd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/components/codetools/examples/testscompleteblock/procedurebeginifbegin1.inc b/components/codetools/examples/testscompleteblock/procedurebeginifbegin1.inc new file mode 100644 index 0000000000..ff58e94404 --- /dev/null +++ b/components/codetools/examples/testscompleteblock/procedurebeginifbegin1.inc @@ -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; + diff --git a/components/codetools/examples/testscompleteblock/unit1.pas b/components/codetools/examples/testscompleteblock/unit1.pas index b0ac31362d..0afd090d2b 100644 --- a/components/codetools/examples/testscompleteblock/unit1.pas +++ b/components/codetools/examples/testscompleteblock/unit1.pas @@ -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}