Commits

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

Extracted the _new_para method.

  • Participants
  • Parent commits 641d609

Comments (0)

Files changed (1)

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

     );
 }
 
+sub _new_para
+{
+    my $self = shift;
+    my $contents = shift;
+
+    return _new_node(
+        {
+            t => "Paragraph",
+            children => $self->_new_list($contents),
+        }
+    );
+}
+
 sub _parse_opening_tag
 {
     my $self = shift;
     return
     +{
          character => $sayer,
-         para => XML::Grammar::Fiction::FromProto::Node::Paragraph->new(
-            children =>
-            $self->_new_list($what),
-            ),
+         para => $self->_new_para($what),
     };
 }
 
 
     my $what = $self->_parse_inner_text();
 
-    return
-        XML::Grammar::Fiction::FromProto::Node::Paragraph->new(
-            children =>
-            $self->_new_list($what),
-        );
+    return $self->_new_para($what);
 }
 
 sub _parse_speech_unit
         $self->_new_list(
             [
                 map { 
-                XML::Grammar::Fiction::FromProto::Node::Paragraph->new(
-                children => $self->_new_list($_),
-                )
+                $self->_new_para($_),
                 } @paragraphs
             ],
         )