[self-follow-up; I neglected to explain a detail of new output]

At 2025-05-10T08:19:01-0500, G. Branden Robinson wrote:
> What we're about to do will produce JSON-formatted output to the
> standard error so let's (1) suppress other output and (2) pipe that
> JSON stuff to jq(1) to pretty-print it.
> 
> $ tg -Wreg -z ATTIC/oliver-set-register-in-macro.groff 2>&1 | jq
> {
>   "name": "pageno",
>   "file name": "ATTIC/oliver-set-register-in-macro.groff",
>   "starting line number": 4,
>   "length": 43,
>   "contents": "\\$1:\u001c         \n.nr xx \\$1     \n0          \n",
>   "node list": []
> }
> 
> We can observe a few things.

We see a U+001C character in the macro contents.  Looking at an ASCII
chart, that's "FILE SEPARATOR".  What's that?

It's how GNU troff encodes special token types.  In this case, it's
`ESCAPE_c`.

You can look up the meanings of these specially encoded tokens in the
"src/roff/troff/input.h" source file.

https://git.savannah.gnu.org/cgit/groff.git/tree/src/roff/troff/input.h?id=0cd44362696c9d65ab59f6014f15221ac53b57f3

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to