/components/codetools/examples/testscompleteblock/procedurebeginifbegin1.inc
http://github.com/graemeg/lazarus · Pascal · 22 lines · 16 code · 3 blank · 3 comment · 2 complexity · e11e5008c6e199c2491d9032d92cafe0 MD5 · raw file
- {%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;