Commits

Anonymous committed 88397eb

Extract a method.

Comments (0)

Files changed (1)

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

     return;
 }
 
+sub _assert_top_is_para
+{
+    my ($self, $open) = @_;
+
+    if ($open->name() ne "p")
+    {
+        Carp::confess (qq{Not a para tag.});
+    }
+
+    return;
+}
+
 sub _close_para
 {
     my $self = shift;
+
     my $open = $self->_pop_tag();
 
-    # This is an assert.
-    if ($open->name() ne "p")
-    {
-        Carp::confess (qq{Not a para tag.});    
-    }
+    $self->_assert_top_is_para($open);
 
     my $children = $open->detach_children();