Files
markdown/source/parser/implementation/markdown-implementation-indented_code_blocks.ads

52 lines
1.4 KiB
Ada
Raw Permalink Normal View History

2022-06-15 19:57:04 +03:00
--
-- Copyright (C) 2021-2023, AdaCore
2022-06-15 19:57:04 +03:00
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2022-06-15 19:57:04 +03:00
--
2022-11-11 12:48:07 +02:00
-- Internal representation of an indented code block
2022-06-15 19:57:04 +03:00
private with VSS.Regular_Expressions;
2022-06-15 19:57:04 +03:00
with VSS.String_Vectors;
package Markdown.Implementation.Indented_Code_Blocks is
pragma Preelaborate;
type Indented_Code_Block is new Abstract_Block with private;
-- An indented code block
function Text (Self : Indented_Code_Block)
return VSS.String_Vectors.Virtual_String_Vector;
-- Return nested annotated text
procedure Detector
(Input : Input_Position;
Tag : in out Ada.Tags.Tag;
CIP : out Can_Interrupt_Paragraph);
-- The detector procedure to find start of a Indented_Code_Block
procedure Initialize;
-- Prepare regexp patterns
2022-06-15 19:57:04 +03:00
private
type Indented_Code_Block is new Abstract_Block with record
Indent : VSS.Strings.Character_Count := 4; -- Overridden in GNATdoc
Lines : VSS.String_Vectors.Virtual_String_Vector;
2022-06-15 19:57:04 +03:00
end record;
overriding function Create
(Input : not null access Input_Position) return Indented_Code_Block;
overriding procedure Append_Line
(Self : in out Indented_Code_Block;
Input : Input_Position;
CIP : Can_Interrupt_Paragraph;
Ok : in out Boolean);
Indent : VSS.Regular_Expressions.Regular_Expression;
-- Some spaces at the beginning of a string: "^ +"
2022-06-15 19:57:04 +03:00
end Markdown.Implementation.Indented_Code_Blocks;