[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #66038] "invalid line length" diagnostic misquotes user input
From: |
G. Branden Robinson |
Subject: |
[bug #66038] "invalid line length" diagnostic misquotes user input |
Date: |
Mon, 29 Jul 2024 02:20:42 -0400 (EDT) |
Update of bug #66038 (group groff):
Status: None => Postponed
Assigned to: None => gbranden
_______________________________________________________
Follow-up Comment #1:
[comment #0 original submission:]
> $ echo '.ll 12u' | groff -Tascii -ww
> troff:<standard input>:1: warning: invalid line length 0u rounded to device
horizontal motion quantum
> (I have not done a build since
[http://git.savannah.gnu.org/cgit/groff.git/commit/?id=4a1898b70 commit
4a1898b70], a few days ago, changed this warning text. It also slightly
refactored the test gating the diagnostic. But it did not change the number
(temp.to_units()) reported by the diagnostic. So, while I'm not running
bleeding-edge code, I'm reasonably confident the bug is still there.)
I don't think it is feasible to do what you desire here without a major change
to input processing.
You say "misquotes" but the parameter is not quoted, and for good reason.
The diagnostic doesn't know what the numerical expression was at the time the
message is constructed. Those input characters are dead and gone, eaten by
the numeric expression interpreter in "number.cpp" (with some bits in
"hvunits.h").
When a request (or escape sequence) expects a numeric expression, it hands the
lexing/parsing ball off to the numeric expression interpreter, which is
responsible for consuming characters until it's "done"--has decided that it
has read a complete one.
Functions like `get_hunits()`, seen in the commit you referenced, would in my
opinion be better named `read_hunits()` because they advance the input cursor
(or "pointer to the input stream buffer" if one wants to think of it that
way).
So unfortunately the sort of diagnostics that complains here would have no
idea what to say if it _did_ want to quote the argument.
It would have two choices if it made the attempt: too soon, or too late.
Setting to "Postponed" status, but it's probably a "Rejected", sorry to say.
Leaving open for comments.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?66038>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
- [bug #66038] "invalid line length" diagnostic misquotes user input, Dave, 2024/07/29
- [bug #66038] "invalid line length" diagnostic misquotes user input,
G. Branden Robinson <=
- [bug #66038] [troff] want "invalid line length" diagnostic to quote user input, G. Branden Robinson, 2024/07/29
- [bug #66038] [troff] want "invalid line length" diagnostic to quote user input, G. Branden Robinson, 2024/07/29
- [bug #66038] [troff] want "invalid line length" diagnostic to quote user input, Dave, 2024/07/29
- [bug #66038] [troff] want "invalid line length" diagnostic to not misrepresent user input, Dave, 2024/07/30
- [bug #66038] [troff] want "invalid line length" diagnostic to not misrepresent user input, G. Branden Robinson, 2024/07/30
- [bug #66038] [troff] want "invalid line length" diagnostic to not misrepresent user input, Dave, 2024/07/30
- [bug #66038] [troff] want "invalid line length" diagnostic to not misrepresent user input, G. Branden Robinson, 2024/07/30
- [bug #66038] [troff] want "invalid line length" diagnostic to not misrepresent user input, G. Branden Robinson, 2024/07/31