mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-02 18:37:38 +01:00
codetools: added example for begin begin end
git-svn-id: trunk@20456 -
This commit is contained in:
parent
f86f672699
commit
6bf2f76a84
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user