diff options
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | src/roff/troff/div.cc | 2 | ||||
-rw-r--r-- | src/roff/troff/div.h | 1 | ||||
-rw-r--r-- | src/roff/troff/input.cc | 16 | ||||
-rw-r--r-- | src/roff/troff/node.h | 4 | ||||
-rw-r--r-- | src/roff/troff/token.h | 9 |
6 files changed, 43 insertions, 6 deletions
@@ -1,3 +1,20 @@ +2001-01-28 Werner LEMBERG <wl@gnu.org> + + Fixed a bug which prevented hyphenation of words which are finished + with `\)'. + + * src/roff/troff/token.h (token): Add enum type + `TOKEN_TRANSPARENT_DUMMY' and method `transparent_dummy()'. + * src/roff/troff/input.cc (token::next, token::description, + get_line_arg, token::add_to_node_list, token::process): Use it. + +2001-01-27 Werner LEMBERG <wl@gnu.org> + + * src/roff/troff/div.h (diversion): Add `saved_prev_line_interrupted'. + * src/roff/troff/div.cc (do_divert): Use it. + + * src/roff/troff/input.cc (asciify): Add ESCAPE_RIGHT_PARENTHESIS. + 2001-01-25 Werner LEMBERG <wl@gnu.org> Adding the `linetabs' request. If set, tab distances are not diff --git a/src/roff/troff/div.cc b/src/roff/troff/div.cc index 4b0b861b..c8d2e256 100644 --- a/src/roff/troff/div.cc +++ b/src/roff/troff/div.cc @@ -101,6 +101,7 @@ void do_divert(int append, int boxing) curenv->space_total = curdiv->saved_space_total; curenv->saved_indent = curdiv->saved_saved_indent; curenv->target_text_length = curdiv->saved_target_text_length; + curenv->prev_line_interrupted = curdiv->saved_prev_line_interrupted; } diversion *temp = curdiv; curdiv = curdiv->prev; @@ -119,6 +120,7 @@ void do_divert(int append, int boxing) curdiv->saved_space_total = curenv->space_total; curdiv->saved_saved_indent = curenv->saved_indent; curdiv->saved_target_text_length = curenv->target_text_length; + curdiv->saved_prev_line_interrupted = curenv->prev_line_interrupted; curenv->line = 0; curenv->start_line(); } diff --git a/src/roff/troff/div.h b/src/roff/troff/div.h index 096b7479..83f9e33c 100644 --- a/src/roff/troff/div.h +++ b/src/roff/troff/div.h @@ -27,6 +27,7 @@ class diversion { int saved_space_total; hunits saved_saved_indent; hunits saved_target_text_length; + int saved_prev_line_interrupted; protected: symbol nm; vunits vertical_position; diff --git a/src/roff/troff/input.cc b/src/roff/troff/input.cc index d89db35a..7069beea 100644 --- a/src/roff/troff/input.cc +++ b/src/roff/troff/input.cc @@ -1343,8 +1343,7 @@ void token::next() return; case ESCAPE_RIGHT_PARENTHESIS: ESCAPE_RIGHT_PARENTHESIS: - type = TOKEN_NODE; - nd = new transparent_dummy_node; + type = TOKEN_TRANSPARENT_DUMMY; return; case '\b': type = TOKEN_BACKSPACE; @@ -1775,6 +1774,8 @@ const char *token::description() return buf; case TOKEN_DUMMY: return "`\\&'"; + case TOKEN_TRANSPARENT_DUMMY: + return "`\\)'"; case TOKEN_ESCAPE: return "`\\e'"; case TOKEN_HYPHEN_INDICATOR: @@ -3769,7 +3770,7 @@ static int get_line_arg(units *n, int si, charinfo **cp) if (start.delimiter(1)) { tok.next(); if (get_number(n, si)) { - if (tok.dummy()) + if (tok.dummy() || tok.transparent_dummy()) tok.next(); if (start != tok) { *cp = tok.get_char(1); @@ -4848,6 +4849,9 @@ const char *asciify(int c) case ESCAPE_AMPERSAND: buf[1] = '&'; break; + case ESCAPE_RIGHT_PARENTHESIS: + buf[1] = ')'; + break; case ESCAPE_UNDERSCORE: buf[1] = '_'; break; @@ -5288,6 +5292,9 @@ int token::add_to_node_list(node **pp) case TOKEN_DUMMY: n = new dummy_node; break; + case TOKEN_TRANSPARENT_DUMMY: + n = new transparent_dummy_node; + break; case TOKEN_ESCAPE: if (escape_char != 0) *pp = (*pp)->add_char(charset_table[escape_char], curenv, &w, &s); @@ -5343,6 +5350,9 @@ void token::process() case TOKEN_DUMMY: curenv->add_node(new dummy_node); break; + case TOKEN_TRANSPARENT_DUMMY: + curenv->add_node(new transparent_dummy_node); + break; case TOKEN_EOF: assert(0); break; diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h index 80095c20..7986ae64 100644 --- a/src/roff/troff/node.h +++ b/src/roff/troff/node.h @@ -310,7 +310,7 @@ class vline_node : public node { vunits x; node *n; public: - vline_node(vunits i, node *c, node *next= 0) : node(next), x(i), n(c) {} + vline_node(vunits i, node *c, node *next= 0) : node(next), x(i), n(c) {} ~vline_node(); node *copy(); void tprint(troff_output_file *); @@ -335,7 +335,7 @@ public: class transparent_dummy_node : public node { public: - transparent_dummy_node() {} + transparent_dummy_node(node *nd = 0) : node(nd) {} node *copy(); int same(node *); const char *type(); diff --git a/src/roff/troff/token.h b/src/roff/troff/token.h index 0bcb72c7..10c592a4 100644 --- a/src/roff/troff/token.h +++ b/src/roff/troff/token.h @@ -33,7 +33,8 @@ class token { TOKEN_BACKSPACE, TOKEN_BEGIN_TRAP, TOKEN_CHAR, // a normal printing character - TOKEN_DUMMY, + TOKEN_DUMMY, // \& + TOKEN_TRANSPARENT_DUMMY, // \) TOKEN_EMPTY, // this is the initial value TOKEN_END_TRAP, TOKEN_ESCAPE, // \e @@ -77,6 +78,7 @@ public: int backspace(); int delimiter(int warn = 0); // is it suitable for use as a delimiter? int dummy(); + int transparent_dummy(); int transparent(); int left_brace(); int right_brace(); @@ -175,6 +177,11 @@ inline int token::dummy() return type == TOKEN_DUMMY; } +inline int token::transparent_dummy() +{ + return type == TOKEN_TRANSPARENT_DUMMY; +} + inline int token::left_brace() { return type == TOKEN_LEFT_BRACE; |