Update of bug #68515 (group groff):

                Category:                 General => Core
              Item Group: Warning/Suspicious behaviour => Test

                  Status:                    None => Need Info
             Assigned to:                    None => barx
                 Summary: hcode-request-copies-spec-char-code.sh possibly
incorrect => [groff] revise or discard hcode-request-copies-spec-char-code.sh
test script

    _______________________________________________________

Follow-up Comment #1:

Over in the 20th comment to bug #68511, I said:

> I'm not in a hurry.  An extra test script, one out of (now) 360, that
> produces false negatives (passes when it shouldn't) doesn't break
> anything for users--it potentially upsets only groff's own developers.
> 
> Another reason is that that test script may not _need_ to be fixed--we
> might just delete it.
> 
>> Comment #11 alluded to opening a separate ticket for it, so I went
>> ahead and did that, 'cause that's quick and easy.  Bug #68515.
> 
> Observe that the implementation of the `hcode` request handler no longer
> has any logic that cares whether a character argument is "ordinary",
> "special", or "indexed".  All it cares about is the character's
> `charinfo`.  So I'm thinking the new "hcode-request-works.sh" test
> should be adequate to cover the special case that prompted the test
> script I've asked you look at it.
> 

> // Because `hcode` doesn't require spaces separating its "arguments",
> // we don't use `has_arg()` except initially to determine whether we
> // have any arguments at all.
> static void set_hyphenation_codes() // .hcode
> {
> if (!has_arg()) {
> warning(WARN_MISSING, "hyphenation code assignment request expects"
> " arguments");
> skip_line();
> return;
> }
> while (read_any_character()) {
> unsigned char cdst = tok.ch();
> if (!tok.is_any_character()) {
> error("cannot apply a hyphenation code to %1", tok.description());
> break;
> }
> if (csdigit(cdst)) {
> error("cannot apply a hyphenation code to a numeral");
> break;
> }
> charinfo *cidst = tok.get_charinfo();
> if ('\0' == cdst) {
> if (0 /* nullptr */ == cidst) {
> error("expected ordinary, special, or indexed character,"
> " got %1", tok.description());
> break;
> }
> }
> tok.next();
> if (!read_any_character()) {
> if (tok.is_newline())
> error("hyphenation codes must be specified in pairs");
> else
> error("cannot copy the hyphenation code of %1",
> tok.description());
> break;
> }
> unsigned char csrc = tok.ch();
> if (csdigit(csrc)) {
> error("cannot use the hyphenation code of a numeral");
> break;
> }
> unsigned char new_code = 0U;
> charinfo *cisrc = tok.get_charinfo();
> if (cisrc != 0 /* nullptr */)
> // Common case: assign destination character the hyphenation code
> // of the source character.
> new_code = cisrc->get_hyphenation_code();
> if ('\0' == csrc) {
> if (0 /* nullptr */ == cisrc) {
> error("expected ordinary, special, or indexed character,"
> " got %1", tok.description());
> break;
> }
> new_code = cisrc->get_hyphenation_code();
> }
> else if (csrc == cdst)
> // If assigning a ordinary character's hyphenation code to itself,
> // use its character code point as the value.
> new_code = tok.ch();
> cidst->set_hyphenation_code(new_code);
> if (cidst->get_translation()
> && cidst->get_translation()->is_translatable_as_input())
> cidst->get_translation()->set_hyphenation_code(new_code);
> tok.next();
> }
> skip_line();
> }


Updating ticket data.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68515>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to