groff-commit
[Top][All Lists]
Advanced

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

[Groff-commit] groff ChangeLog src/roff/troff/input.cpp


From: Werner LEMBERG
Subject: [Groff-commit] groff ChangeLog src/roff/troff/input.cpp
Date: Tue, 30 Sep 2008 13:47:36 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     08/09/30 13:47:36

Modified files:
        .              : ChangeLog 
        src/roff/troff : input.cpp 

Log message:
        Restore behaviour of \$0 if a macro is called with string syntax
        (problem caused by change on 2008-09-29).
        
        * src/roff/troff/input.cpp (input_iterator, input_stack,
        macro_iterator): Add `get_macro_name' member function.
        (interpolate_string): Use it.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.1145&r2=1.1146
http://cvs.savannah.gnu.org/viewcvs/groff/src/roff/troff/input.cpp?cvsroot=groff&r1=1.53&r2=1.54

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.1145
retrieving revision 1.1146
diff -u -b -r1.1145 -r1.1146
--- ChangeLog   29 Sep 2008 21:56:05 -0000      1.1145
+++ ChangeLog   30 Sep 2008 13:47:35 -0000      1.1146
@@ -1,3 +1,12 @@
+2008-09-30  Werner LEMBERG  <address@hidden>
+
+       Restore behaviour of \$0 if a macro is called with string syntax
+       (problem caused by change on 2008-09-29).
+
+       * src/roff/troff/input.cpp (input_iterator, input_stack,
+       macro_iterator): Add `get_macro_name' member function.
+       (interpolate_string): Use it.
+
 2008-09-29  Werner LEMBERG  <address@hidden>
 
        Make \\*[xxx]\\ within a macro (with `xxx' a macro too) work as

Index: src/roff/troff/input.cpp
===================================================================
RCS file: /cvsroot/groff/groff/src/roff/troff/input.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- src/roff/troff/input.cpp    29 Sep 2008 21:56:05 -0000      1.53
+++ src/roff/troff/input.cpp    30 Sep 2008 13:47:35 -0000      1.54
@@ -220,6 +220,7 @@
   virtual int nargs() { return 0; }
   virtual input_iterator *get_arg(int) { return 0; }
   virtual arg_list *get_arg_list() { return 0; }
+  virtual symbol get_macro_name() { return NULL_SYMBOL; }
   virtual int space_follows_arg(int) { return 0; }
   virtual int get_break_flag() { return 0; }
   virtual int get_location(int, const char **, int *) { return 0; }
@@ -422,6 +423,7 @@
   static void push(input_iterator *);
   static input_iterator *get_arg(int);
   static arg_list *get_arg_list();
+  static symbol get_macro_name();
   static int space_follows_arg(int);
   static int get_break_flag();
   static int nargs();
@@ -639,6 +641,15 @@
   return 0;
 }
 
+symbol input_stack::get_macro_name()
+{
+  input_iterator *p;
+  for (p = top; p != 0; p = p->next)
+    if (p->has_args())
+      return p->get_macro_name();
+  return NULL_SYMBOL;
+}
+
 int input_stack::space_follows_arg(int i)
 {
   input_iterator *p;
@@ -3671,6 +3682,7 @@
   int has_args() { return 1; }
   input_iterator *get_arg(int);
   arg_list *get_arg_list();
+  symbol get_macro_name();
   int space_follows_arg(int);
   int get_break_flag() { return with_break; }
   int nargs() { return argc; }
@@ -3701,6 +3713,11 @@
   return args;
 }
 
+symbol macro_iterator::get_macro_name()
+{
+  return nm;
+}
+
 int macro_iterator::space_follows_arg(int i)
 {
   if (i > 0 && i <= argc) {
@@ -4312,7 +4329,9 @@
       input_stack::push(si);
      }
     else {
-      macro_iterator *mi = new macro_iterator(nm, *m, "string", 1);
+      // if a macro is called as a string, \$0 doesn't get changed
+      macro_iterator *mi = new macro_iterator(input_stack::get_macro_name(),
+                                             *m, "string", 1);
       input_stack::push(mi);
     }
   }




reply via email to

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