summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwl <wl>2008-09-28 14:39:43 +0000
committerwl <wl>2008-09-28 14:39:43 +0000
commit1edd36d242441d5a475b62dbd8b8d526be1b9d68 (patch)
tree227d35deaf6777f8eb7745af8f984016a299c494 /src
parent44bc85fbfd14a4678ec9ec8a2dce7206fd2d8bc3 (diff)
downloadgroff-1edd36d242441d5a475b62dbd8b8d526be1b9d68.tar.gz
If a macro is called as a string, inherit value of \n[.br] from the
caller. This is useful for `trace.tmac'. * src/roff/troff/input.cpp (string_iterator): New members `with_break' and `get_break_flag'. (string_iterator::string_iterator): Updated. * doc/groff.texinfo: Improve documentation of \$0 and string syntax calling of macros. Document behaviour of \n[.br] within strings.
Diffstat (limited to 'src')
-rw-r--r--src/roff/troff/input.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 58e576b4..5605b232 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -3373,15 +3373,17 @@ class string_iterator : public input_iterator {
int count; // of characters remaining
node *nd;
int saved_compatible_flag;
+ int with_break; // inherited from the caller
protected:
symbol nm;
string_iterator();
public:
- string_iterator(const macro &m, const char *p = 0, symbol s = NULL_SYMBOL);
+ string_iterator(const macro &, const char * = 0, symbol = NULL_SYMBOL);
int fill(node **);
int peek();
int get_location(int, const char **, int *);
void backtrace();
+ int get_break_flag() { return with_break; }
void save_compatible_flag(int f) { saved_compatible_flag = f; }
int get_compatible_flag() { return saved_compatible_flag; }
int is_diversion();
@@ -3402,6 +3404,7 @@ string_iterator::string_iterator(const macro &m, const char *p, symbol s)
nd = 0;
ptr = eptr = 0;
}
+ with_break = input_stack::get_break_flag();
}
string_iterator::string_iterator()
@@ -3413,6 +3416,7 @@ string_iterator::string_iterator()
how_invoked = 0;
lineno = 1;
count = 0;
+ with_break = input_stack::get_break_flag();
}
int string_iterator::is_diversion()