discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Forwarding arguments with \\$@ to the end of a mdoc macro invocation explodes if given ;
@ 2024-07-07 16:54 наб
  2024-07-07 17:01 ` наб
  0 siblings, 1 reply; 2+ messages in thread
From: наб @ 2024-07-07 16:54 UTC (permalink / raw)
  To: discuss

[-- Attachment #1: Type: text/plain, Size: 1737 bytes --]

mandoc from 2022-10-26 and from 20 minutes ago agree on the following:

Given:
  .de St-p1003.1-2024
  .Tn \%IEEE No Std 1003.1-2024 Pq Dq Tn \%POSIX Ns .1 \\$@
  ..
then
  .St-p1003.1-2024
  .St-p1003.1-2024 ,
  .St-p1003.1-2024 .
all work as expected.
But
  .St-p1003.1-2024 ;
causes -Tlint to produce
  ERROR: incomplete escape sequence: \$\&
  ERROR: argument number is not numeric: \$\&
and formats as
  STANDARDS
       IEEE Std 1003.1-2024 (“POSIX.1”). Fl zqvFs, unit - suffixed. Ar lines
       and. Ar bytes,. Fl - pid,. Fl - max - unchanged - stats,. Fl - retry, and
       more than one. Ar file are extensions, originating_the GNU system. With.
       Fl r,. Fl c is an extension, originating_the. Bx.. Xr sleep 1 Ns - style
       suffixes for. Fl s are extensions.. Fl f is not required^detect
       truncations (and is only strictly required^work for regular files and
&c. The parser is completely exploded. Fl zqvFs and everything forward
is underlined. This is fixed by the next .Sh.

Bookworm mandoc (1.14.6-1+b1) instead -Tlints as
  ERROR: argument number is not numeric: \$\
and formats as
  STANDARDS
       IEEE Std 1003.1-2024 (“POSIX.1 &”). Fl zqvFs, unit - suffixed. Ar lines
       and. Ar bytes,. Fl - pid,. Fl - max - unchanged - stats,. Fl - retry, and
       more than one. Ar file are extensions, originating_the GNU system. With.
       Fl r,. Fl c is an extension, originating_the. Bx.. Xr sleep 1 Ns - style
       suffixes for. Fl s are extensions.. Fl f is not required^detect
&c. The parser is completely exploded. Fl zqvFs and everything forward
is underlined. This is fixed by the next .Sh.

All punctuation works as expected under groff.

Best,

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Forwarding arguments with \\$@ to the end of a mdoc macro invocation explodes if given ;
  2024-07-07 16:54 Forwarding arguments with \\$@ to the end of a mdoc macro invocation explodes if given ; наб
@ 2024-07-07 17:01 ` наб
  0 siblings, 0 replies; 2+ messages in thread
From: наб @ 2024-07-07 17:01 UTC (permalink / raw)
  To: discuss

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

Nope, that's not it actually, all punctuation works.
I didn't realise that this is the only file where had eqn delims on.
Are you ready?

  .de St-p1003.1-2024
  .Tn \%IEEE No Std 1003.1-2024 Pq Dq Tn \%POSIX Ns .1 \\$@
  ..
  .EQ
  delim @@
  .EN
  .St-p1003.1-2024
produces
  ERROR: incomplete escape sequence: \$\&
  ERROR: argument number is not numeric: \$\&
(and the other one on older mandoc).

Because rather than parsing \$@ correctly as "all arguments",
eqn somehow sees this (I don't even think it should under normal troff?)
and tries consuming @...@, and replaces it with the rendered output of \&.
Thus, I think, \$\&?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-07 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-07 16:54 Forwarding arguments with \\$@ to the end of a mdoc macro invocation explodes if given ; наб
2024-07-07 17:01 ` наб

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).