Commits

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

Extract two asserts.

  • Participants
  • Parent commits f63ed32

Comments (0)

Files changed (1)

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

     );
 }
 
-sub _new_para
+
+sub _assert_not_contains_saying
 {
-    my $self = shift;
-    my $contents = shift;
+    my ($self, $contents) = @_;
 
-    # This is an assert
     if (List::MoreUtils::any 
         { ref($_) ne "" && $_->isa("XML::Grammar::Fiction::FromProto::Node::Saying") }
         @{$contents || []}
         Carp::confess (qq{Para contains a saying.});
     }
 
+    return;
+}
+
+sub _assert_not_contains_undef
+{
+    my ($self, $contents) = @_;
+
     # This is an assert
     if (List::MoreUtils::any 
         { !defined($_) }
         Carp::confess (qq{Para contains an undef member.});
     }
 
+    return;
+}
+
+
+sub _new_para
+{
+    my ($self, $contents) = @_;
+
+    $self->_assert_not_contains_saying($contents);
+    $self->_assert_not_contains_undef($contents);
 
     return $self->_new_node(
         {