Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 559f5f3

Moved _handle_open_tag to the XmlIterator base class.

  • Participants
  • Parent commits 7a673ef

Comments (0)

Files changed (3)

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm

     return;
 }
 
-sub _handle_open_tag
-{
-    my $self = shift;
-
-    my $open = $self->_parse_opening_tag();
-
-    $open->children([]);
-
-    $self->_push_tag($open);
-
-    return;
-}
-
 before '_handle_close_tag' => sub { 
     my $self = shift;
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Parser/XmlIterator.pm

     }
 }
 
+sub _handle_open_tag
+{
+    my $self = shift;
+
+    my $open = $self->_parse_opening_tag();
+
+    $open->children([]);
+
+    # TODO : add the check for is_standalone in XML-Grammar-Fiction
+    # too.
+    if ($open->is_standalone())
+    {
+        if (defined($self->_merge_tag($open)))
+        {
+            Carp::confess ("Top element/tag cannot be standalone.");
+        }
+        else
+        {
+            return;
+        }
+    }
+
+    $self->_push_tag($open);
+
+    return;
+}
+
 sub _generate_text_unit_events
 {
     my $self = shift;

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/FromProto/Parser/QnD.pm

     return;
 }
 
-sub _handle_open_tag
-{
+after '_handle_open_tag' => sub {
     my $self = shift;
 
-    my $open = $self->_parse_opening_tag();
-
-    $open->children([]);
-
-    # TODO : add the check for is_standalone in XML-Grammar-Fiction
-    # too.
-    if ($open->is_standalone())
-    {
-        if (defined($self->_merge_tag($open)))
-        {
-            Carp::confess ("Top element/tag cannot be standalone.");
-        }
-        else
-        {
-            return;
-        }
-    }
-    $self->_push_tag($open);
-
-    if ($open->name() eq "desc")
+    if ($self->_top_tag()->name() eq "desc")
     {
         $self->_start_para();
     }
 
     return;
-}
+};
 
 before '_handle_close_tag' => sub { 
     my $self = shift;