Changeset 32


Ignore:
Timestamp:
Jun 4, 2014, 11:59:24 AM (7 years ago)
Author:
vadim.godunko
Message:

Refactor handling of nesting constructs into tagged type.

Location:
trunk/forge/source/wiki
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/forge/source/wiki/forge-wiki-block_parsers-lists.adb

    r30 r32  
    7979        Namespace_URI => HTML5_URI);
    8080
    81       if Next /= null then
    82          if Next.Offset < Self.Offset then
     81      case Forge.Wiki.Block_Parsers.Nestables.Nestable_Block_Parser
     82            (Self.all).End_Block (Next)
     83      is
     84         when Continue =>
     85            return Continue;
     86
     87         when Unwind =>
    8388            Self.Writer.End_Element
    8489             (Local_Name    => UL_Tag,
     
    8691
    8792            return Unwind;
    88 
    89          elsif Next.Offset = Self.Offset
    90            and Next.all in List_Block_Parser'Class
    91          then
    92             return Continue;
    93          end if;
    94 
    95       else
    96          Self.Writer.End_Element
    97           (Local_Name    => UL_Tag,
    98            Namespace_URI => HTML5_URI);
    99 
    100          return Unwind;
    101       end if;
    102 
    103       return Continue;
     93      end case;
    10494   end End_Block;
    10595
  • trunk/forge/source/wiki/forge-wiki-block_parsers-lists.ads

    r27 r32  
    4040--  $Revision$ $Date$
    4141------------------------------------------------------------------------------
     42with Forge.Wiki.Block_Parsers.Nestables;
    4243
    4344package Forge.Wiki.Block_Parsers.Lists is
     
    4647
    4748   type List_Block_Parser is
    48      new Forge.Wiki.Block_Parsers.Abstract_Block_Parser with record
     49     new Forge.Wiki.Block_Parsers.Nestables.Nestable_Block_Parser with record
    4950      Text_Offset : Positive;
    5051   end record;
  • trunk/forge/source/wiki/forge-wiki-block_parsers-paragraphs.adb

    r30 r32  
    7373        Namespace_URI => HTML5_URI);
    7474
    75       if Next /= null then
    76          if Next.Offset < Self.Offset then
    77             return Unwind;
    78          end if;
    79 
    80       else
    81          return Unwind;
    82       end if;
    83 
    84       return Continue;
     75      return
     76        Forge.Wiki.Block_Parsers.Nestables.Nestable_Block_Parser
     77         (Self.all).End_Block (Next);
    8578   end End_Block;
    8679
  • trunk/forge/source/wiki/forge-wiki-block_parsers-paragraphs.ads

    r27 r32  
    4040--  $Revision$ $Date$
    4141------------------------------------------------------------------------------
     42with Forge.Wiki.Block_Parsers.Nestables;
    4243
    4344package Forge.Wiki.Block_Parsers.Paragraphs is
     
    4647
    4748   type Paragraph_Block_Parser is
    48      new Forge.Wiki.Block_Parsers.Abstract_Block_Parser with null record;
     49     new Forge.Wiki.Block_Parsers.Nestables.Nestable_Block_Parser
     50       with null record;
    4951
    5052   overriding function Start_Block
  • trunk/forge/source/wiki/forge-wiki-block_parsers.ads

    r30 r32  
    6060
    6161   type Abstract_Block_Parser is abstract tagged limited record
    62       Offset : Positive;
    6362      Writer : Forge.Types.SAX_Writer_Access;
    6463   end record;
Note: See TracChangeset for help on using the changeset viewer.