Commits

Anonymous committed c6bf411

Extract two asserts.

Comments (0)

Files changed (1)

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(
         {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.