gbranden pushed a commit to branch master
in repository groff.
commit 6aa829e9ab6fddd287d0e735c5776f25df948212
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 8 18:18:31 2026 -0600
[troff]: Annotate.
---
src/roff/troff/column.cpp | 2 ++
src/roff/troff/div.cpp | 4 ++++
src/roff/troff/input.cpp | 7 +++++++
src/roff/troff/node.cpp | 2 ++
src/roff/troff/number.cpp | 3 +++
src/roff/troff/reg.h | 1 -
6 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/roff/troff/column.cpp b/src/roff/troff/column.cpp
index 89fc1a2d3..99725964f 100644
--- a/src/roff/troff/column.cpp
+++ b/src/roff/troff/column.cpp
@@ -725,6 +725,8 @@ void init_column_requests()
register_dictionary.define(".colx", new column_extra_space_reg);
register_dictionary.define(".cola", new column_active_reg);
register_dictionary.define(".nvj",
+ // should be a readonly_boolean_register
+ // TODO: or readonly_register<bool>
new readonly_register(&no_vjustify_mode));
}
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 5785a0792..ef4d2928c 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -61,7 +61,9 @@ static bool began_page_in_eoi_macro = false;
int last_page_number = 0; // if > 0, the number of the last page
// specified with -o
+// XXX: type should be `vunits`, not `int`
static int last_post_line_extra_space = 0; // needed for \n(.a
+
static int nl_reg_contents = -1;
static int dl_reg_contents = 0;
static int dn_reg_contents = 0;
@@ -1332,6 +1334,7 @@ void init_div_requests()
init_request("vpt", configure_vertical_position_traps_request);
init_request("wh", when_request);
register_dictionary.define(".a",
+ // TODO: should be readonly_register<vunits>
new readonly_register(&last_post_line_extra_space));
register_dictionary.define(".d", new vertical_position_reg);
register_dictionary.define(".h", new high_water_mark_reg);
@@ -1348,6 +1351,7 @@ void init_div_requests()
register_dictionary.define(".trunc",
new constant_vunits_reg(&truncated_space));
register_dictionary.define(".vpt",
+ // TODO: should be readonly_register<bool>
new readonly_boolean_register(&honor_vertical_position_traps));
register_dictionary.define(".z", new diversion_name_reg);
register_dictionary.define("dl", new variable_reg(&dl_reg_contents));
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 8b770697e..b1fbbe242 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -10484,6 +10484,7 @@ int main(int argc, char **argv)
#endif /* COLUMN */
init_node_requests();
register_dictionary.define(".T",
+ // TODO: should be readonly_register<bool>
new readonly_boolean_register(&have_explicit_device_argument));
init_registers();
init_reg_requests();
@@ -10689,16 +10690,22 @@ void init_input_requests()
register_dictionary.define(".$", new nargs_reg);
register_dictionary.define(".br", new break_flag_reg);
register_dictionary.define(".c", new lineno_reg);
+ // TODO: should be readonly_register<bool>
register_dictionary.define(".C", new
readonly_boolean_register(&want_att_compat));
+ // TODO: should be readonly_register<bool>
register_dictionary.define(".color", new
readonly_boolean_register(&want_color_output));
register_dictionary.define(".cp", new enclosing_want_att_compat_reg);
register_dictionary.define(".F", new filename_reg);
register_dictionary.define(".g", new readonly_text_register(1));
+ // TODO: should be readonly_register<hunits>
register_dictionary.define(".H", new readonly_register(&hresolution));
+ // TODO: should be readonly_register<int>
register_dictionary.define(".O", new readonly_register(&suppression_level));
register_dictionary.define(".pi", new pipe_command_reg);
register_dictionary.define(".R", new readonly_text_register(INT_MAX));
+ // TODO: should be readonly_register<bool>
register_dictionary.define(".U", new
readonly_boolean_register(&want_unsafe_requests));
+ // TODO: should be readonly_register<vunits>
register_dictionary.define(".V", new readonly_register(&vresolution));
register_dictionary.define(".warn", new
readonly_mask_register(&desired_warnings));
extern const char *major_version;
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 97bd48fee..63e26dc3a 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -7698,8 +7698,10 @@ void init_node_requests()
register_dictionary.define(".fp",
new next_available_font_mounting_position_reg);
register_dictionary.define(".kern",
+ // TODO: should be readonly_register<bool>
new readonly_boolean_register(&global_kern_mode));
register_dictionary.define(".lg",
+ // TODO: should be readonly_register<int>
new readonly_register(&global_ligature_mode));
register_dictionary.define(".P", new printing_reg);
soft_hyphen_char = lookup_charinfo(HYPHEN_SYMBOL);
diff --git a/src/roff/troff/number.cpp b/src/roff/troff/number.cpp
index 540b296dc..8c05ef9bc 100644
--- a/src/roff/troff/number.cpp
+++ b/src/roff/troff/number.cpp
@@ -50,8 +50,11 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
const vunits V0; // zero in vertical units
const hunits H0; // zero in horizontal units
+// XXX: type should be `hunits`, not `units`
units hresolution = 1;
+// XXX: type should be `vunits`, not `units`
units vresolution = 1;
+
units units_per_inch;
int sizescale; // subdivisions per point
diff --git a/src/roff/troff/reg.h b/src/roff/troff/reg.h
index 8b046e575..f1ee60dbc 100644
--- a/src/roff/troff/reg.h
+++ b/src/roff/troff/reg.h
@@ -33,7 +33,6 @@ public:
};
// TODO: Use template to parameterize class in the pointed-to data type?
-
class readonly_register : public reg {
int *p;
public:
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit