Follow-up Comment #27, bug #67571 (group groff): Dave,
You were right and I was wrong. Now that I found the right place to look,
it's clear to me that Werner intended to OR together all character flags that
"apply" to a `charinfo` of interest, and the only way that isn't a trivial
lookup on a `charinfo`'s `flags` member variable is by searching classes to
see if they contain the charinfo of interest (or, more precisely, its Unicode
code point).
'Cause that's exactly what `charinfo::get_flags()` does as Werner originally
implemented it.
$ git show 1cb8dd7bde -- src/roff/troff/input.cpp | sed -n '/\/\/ Get the
union/,+19p'
+// Get the union of all flags affecting this charinfo.
+unsigned char charinfo::get_flags()
+{
+ unsigned char all_flags = flags;
+ dictionary_iterator iter(char_class_dictionary);
+ charinfo *cp;
+ symbol s;
+ while (iter.get(&s, (void **)&cp)) {
+ assert(!s.is_null());
+ if (cp->contains(get_unicode_code())) {
+#if defined(DEBUGGING)
+ if (debug_state)
+ fprintf(stderr, "charinfo::get_flags %p %s %d\n",
+ (void *)cp, cp->nm.contents(), cp->flags);
+#endif
+ all_flags |= cp->flags;
+ }
+ }
+ return all_flags;
+}
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67571>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
