gbranden pushed a commit to branch branden-2023-07-05 in repository groff. commit a4426596a3740880491f6f9c41f1267e5c968793 Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Thu May 18 23:48:40 2023 -0500
[eqn]: Trivially refactor. Rename "space_box" class to "full_space_box" for clarity and to prepare for adding distinct thin and thick space box classes. * src/preproc/eqn/box.cpp (space_box::space_box, space_box::output, space_box::debug_print): * src/preproc/eqn/box.h (class space_box): Rename these... * src/preproc/eqn/box.cpp (full_space_box::full_space_box, full_space_box::output, full_space_box::debug_print): * src/preproc/eqn/box.h (class full_space_box): ...to these. * src/preproc/eqn/eqn.ypp (simple): Construct item using new type name. Also update editor aid comments; drop old style Emacs file-local variable setting. --- ChangeLog | 15 +++++++++++++++ src/preproc/eqn/box.cpp | 6 +++--- src/preproc/eqn/box.h | 11 ++++++++--- src/preproc/eqn/eqn.ypp | 2 +- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc5dc307d..a856f6068 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2023-05-18 G. Branden Robinson <g.branden.robin...@gmail.com> + + [eqn]: Trivially refactor. Rename "space_box" class to + "full_space_box" for clarity and to prepare for adding distinct + thin and thick space box classes. + + * src/preproc/eqn/box.cpp (space_box::space_box) + (space_box::output, space_box::debug_print): + * src/preproc/eqn/box.h (class space_box): Rename these... + * src/preproc/eqn/box.cpp (full_space_box::full_space_box) + (full_space_box::output, full_space_box::debug_print): + * src/preproc/eqn/box.h (class full_space_box): ...to these. + * src/preproc/eqn/eqn.ypp (simple): Construct item using new + type name. + 2023-05-18 G. Branden Robinson <g.branden.robin...@gmail.com> * src/roff/troff/hvunits.h: Boolify. diff --git a/src/preproc/eqn/box.cpp b/src/preproc/eqn/box.cpp index 933b7bf3b..cf3e7ac48 100644 --- a/src/preproc/eqn/box.cpp +++ b/src/preproc/eqn/box.cpp @@ -589,12 +589,12 @@ void tab_box::check_tabs(int level) } } -space_box::space_box() +full_space_box::full_space_box() { spacing_type = SUPPRESS_TYPE; } -void space_box::output() +void full_space_box::output() { if (output_format == troff) printf("\\h'%dM'", thick_space); @@ -635,7 +635,7 @@ void half_space_box::debug_print() fprintf(stderr, "^"); } -void space_box::debug_print() +void full_space_box::debug_print() { fprintf(stderr, "~"); } diff --git a/src/preproc/eqn/box.h b/src/preproc/eqn/box.h index 6d1934638..b21e2e329 100644 --- a/src/preproc/eqn/box.h +++ b/src/preproc/eqn/box.h @@ -1,4 +1,3 @@ -// -*- C++ -*- /* Copyright (C) 1989-2020 Free Software Foundation, Inc. Written by James Clark (j...@jclark.com) @@ -176,9 +175,9 @@ public: void debug_print(); }; -class space_box : public simple_box { +class full_space_box : public simple_box { public: - space_box(); + full_space_box(); void output(); void debug_print(); }; @@ -276,3 +275,9 @@ void init_char_table(); void init_extensible(); void define_extensible(const char *name, const char *ext, const char *top = 0, const char *mid = 0, const char *bot = 0); + +// Local Variables: +// fill-column: 72 +// mode: C++ +// End: +// vim: set cindent noexpandtab shiftwidth=2 textwidth=72: diff --git a/src/preproc/eqn/eqn.ypp b/src/preproc/eqn/eqn.ypp index 4e806d8d7..3843bf4da 100644 --- a/src/preproc/eqn/eqn.ypp +++ b/src/preproc/eqn/eqn.ypp @@ -203,7 +203,7 @@ simple: | '^' { $$ = new half_space_box; } | '~' - { $$ = new space_box; } + { $$ = new full_space_box; } | '\t' { $$ = new tab_box; } | '{' equation '}' _______________________________________________ Groff-commit mailing list Groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit