Commits

Anonymous committed cf36393

Restructred the ->_short_isa_ call, so the func will be easier to modify.

This is part of the ongoing refactorings of the FromProto modules.

Comments (0)

Files changed (2)

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto.pm

 {
     my ($self, $elem) = @_;
 
-    if ($elem->name() eq "title")
+    if ($elem->_short_isa("InnerDesc"))
+    {
+        $self->_output_tag_with_childs(
+            {
+                start => ["inlinedesc"],
+                elem => $elem,
+            }
+        );
+    }
+    elsif ($elem->name() eq "title")
     {
         # TODO :
         # Eliminate the Law-of-Demeter-syndrome here.
     {
         $self->_writer->emptyTag("br");
     }
-    elsif ($elem->_short_isa("InnerDesc"))
-    {
-        $self->_output_tag_with_childs(
-            {
-                start => ["inlinedesc"],
-                elem => $elem,
-            }
-        );
-    }
 
     return;
 }

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

 {
     my ($self, $elem) = @_;
 
-    if (($elem->name() eq "s") || ($elem->name() eq "section"))
+    if ($elem->_short_isa("InnerDesc"))
+    {
+        $self->_output_tag_with_childs(
+            {
+                start => ["inlinedesc"],
+                elem => $elem,
+            }
+        );
+    }
+    elsif (($elem->name() eq "s") || ($elem->name() eq "section"))
     {
         $self->_write_scene({scene => $elem});
     }
     {
         $self->_writer->emptyTag("br");
     }
-    elsif ($elem->_short_isa("InnerDesc"))
-    {
-        $self->_output_tag_with_childs(
-            {
-                start => ["inlinedesc"],
-                elem => $elem,
-            }
-        );
-    }
 
     return;
 }