groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff-commit] groff ChangeLog src/roff/grog/grog.pl


From: Werner LEMBERG
Subject: [Groff-commit] groff ChangeLog src/roff/grog/grog.pl
Date: Thu, 24 May 2012 11:38:14 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     12/05/24 11:38:14

Modified files:
        .              : ChangeLog 
        src/roff/grog  : grog.pl 

Log message:
        * src/roff/grog/grog.pl (process): Fix .so handling.
        
        This does the same as the previous commit.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.1335&r2=1.1336
http://cvs.savannah.gnu.org/viewcvs/groff/src/roff/grog/grog.pl?cvsroot=groff&r1=1.21&r2=1.22

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.1335
retrieving revision 1.1336
diff -u -b -r1.1335 -r1.1336
--- ChangeLog   24 May 2012 11:35:43 -0000      1.1335
+++ ChangeLog   24 May 2012 11:38:14 -0000      1.1336
@@ -1,3 +1,9 @@
+2012-05-24  Werner LEMBERG  <address@hidden>
+
+       * src/roff/grog/grog.pl (process): Fix .so handling.
+
+       This does the same as the previous commit.
+
 2012-05-24  Denis M. Wilson  <address@hidden>
 
        * src/roff/grog/grog.sh: Fix .so handling.

Index: src/roff/grog/grog.pl
===================================================================
RCS file: /cvsroot/groff/groff/src/roff/grog/grog.pl,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- src/roff/grog/grog.pl       22 Jan 2011 15:18:57 -0000      1.21
+++ src/roff/grog/grog.pl       24 May 2012 11:38:14 -0000      1.22
@@ -131,25 +131,25 @@
       $Groff{'soelim'}++ if $level;
     } elsif (/^\.TS$Sp/) {
       $_ = <FILE>;
-      if (!/^\./) {
+      if (!/^\./ || /^\.so/) {
        $Groff{'tbl'}++;
        $Groff{'soelim'}++ if $level;
       }
     } elsif (/^\.EQ$Sp/) {
       $_ = <FILE>;
-      if (!/^\./ || /^\.[0-9]/) {
+      if (!/^\./ || /^\.[0-9]/ || /^\.so/) {
        $Groff{'eqn'}++;
        $Groff{'soelim'}++ if $level;
       }
     } elsif (/^\.GS$Sp/) {
       $_ = <FILE>;
-      if (!/^\./) {
+      if (!/^\./ || /^\.so/) {
        $Groff{'grn'}++;
        $Groff{'soelim'}++ if $level;
       }
     } elsif (/^\.G1$Sp/) {
       $_ = <FILE>;
-      if (!/^\./) {
+      if (!/^\./ || /^\.so/) {
        $Groff{'grap'}++;
        $Groff{'soelim'}++ if $level;
       }
@@ -160,7 +160,7 @@
 #      &process($1, $level);
 #      } else {
 #      $_ = <FILE>;
-#      if (!/^\./ || /^\.ps/) {
+#      if (!/^\./ || /^\.ps/ || /^\.so/) {
 #        $Groff{'pic'}++;
 #        $Groff{'soelim'}++ if $level;
 #      }
@@ -243,6 +243,22 @@
       s/^.so *//;
       s/\\\".*//;
       s/ .*$//;
+      # The next if-clause catches e.g.
+      #
+      #   .EQ
+      #   .so foo
+      #   .EN
+      #
+      # However, the code is not fully correct since it is too generous.
+      # Theoretically, we should check for .so only within preprocessor
+      # blocks like .EQ/.EN or .TS/.TE; but it doesn't harm if we call
+      # soelim even if we don't need to.
+      if ( $Groff{'pic'} || $Groff{'tbl'} || $Groff{'eqn'} ||
+          $Groff{'grn'} || $Groff{'grap'} || $Groff{'refer'} ||
+          $Groff{'refer_open'} || $Groff{'refer_close'} ||
+          $Groff{'chem'} ) {
+       $Groff{'soelim'}++;
+      }
       &process($_, $level + 1) unless /\\/ || $_ eq "";
     }
   }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]