Update of /cvsroot/monetdb/buildtools/Mx
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2998

Modified Files:
      Tag: MonetDB_1-22
        Print.c 
Log Message:
improving texi output of code pieces


Index: Print.c
===================================================================
RCS file: /cvsroot/monetdb/buildtools/Mx/Print.c,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -d -r1.6.2.1 -r1.6.2.2
--- Print.c     5 Feb 2008 22:32:35 -0000       1.6.2.1
+++ Print.c     5 Feb 2008 23:09:22 -0000       1.6.2.2
@@ -22,9 +22,6 @@
 #include       "Mx.h"
 #include       "MxFcnDef.h"
 
-#define TEXIMODE (textmode==M_TEXI)
-
-
 int pr_hide = 0;
 int pr_hide_text = 0;
 int pr_env = 0;
@@ -43,8 +40,7 @@
 
        switch (pr_env) {
        case E_CODE:
-               if TEXIMODE 
-                       ofile_printf("@end example\n");
+               ofile_printf("@end example\n");
                break;
        case E_TEXT:
        case E_CMD:
@@ -54,8 +50,7 @@
        pr_pos = 0;
        switch (pr_env) {
        case E_CODE:
-               if TEXIMODE 
-                       ofile_printf("@example\n");
+               ofile_printf("@example\n");
                break;
        case E_TEXT:
        case E_CMD:
@@ -114,27 +109,15 @@
                        ofile_printf("{%c}", c);
                        break;
                case '@':
-                       if TEXIMODE {
-                               ofile_puts("@@");
-                               break;
-                       }
-                       MathOff();
-                       ofile_printf("@");
+                       ofile_puts("@@");
                        break;
                case '#':
-                       if TEXIMODE {
-                               ofile_puts("\\#");
-                               break;
-                       }
-                       MathOff();
-                       ofile_printf("\\%c", c);
+                       ofile_puts("\\#");
                        break;
                case '{':
                case '}':
-                       if TEXIMODE {
-                               ofile_printf("@%c", c);
-                               break;
-                       }
+                       ofile_printf("@%c", c);
+                       break;
                case '&':
                case '%':
                case '$':
@@ -204,15 +187,8 @@
                pr_pos++;
        }
 
-       if (TEXIMODE) {
-               switch (c) {
-               case '{':
-               case '}':
-               case '$':
-               case '#':
-               default:
-                       ofile_putc(c);
-               }
+       if ((pr_env & E_TEXT) == E_TEXT) {
+               ofile_putc(c);
                return;
        }
 
@@ -225,6 +201,15 @@
                case '\\':
                        ofile_puts("\\");
                        break;
+               case '{':
+               case '}':
+               case '$':
+               case '@':
+                       ofile_printf("@%c", c);
+                       break;
+               case '#':
+                       ofile_printf("\\#");
+                       break;
                default:
                        ofile_putc(c);
                }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to