/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

  1. {%MainUnit unit1.pas}
  2. procedure Do1;
  3. procedure BeginBlock(Typ: TFABBlockType);
  4. var
  5. ParentBlock: PBlock;
  6. begin
  7. if (Stack.Top>=0) then begin
  8. ParentBlock:=@Stack.Stack[Stack.Top];
  9. if (ParentBlock^.InnerStartPos=AtomStart)
  10. and (Policies<>nil) then begin
  11. Policies.AddIndent(ParentBlock^.Typ,Typ,ParentBlock^.InnerIdent);
  12. end;
  13. Stack.BeginBlock(Typ,AtomStart);
  14. {$IFDEF ShowCodeBeautifierParser}
  15. DebugLn([GetIndentStr(Stack.Top*2),'BeginBlock ',FABBlockTypeNames[Typ],' ',GetAtomString(@Src[AtomStart],NestedComments),' at ',PosToStr(p)]);
  16. {$ENDIF}
  17. end;
  18. begin
  19. end;