unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#62869: Texinfo: texi-fragment->stexi: Parsing verbatim fails when no newline
@ 2023-04-15 19:07 Luis Felipe via Bug reports for GUILE, GNU's Ubiquitous Extension Language
  0 siblings, 0 replies; only message in thread
From: Luis Felipe via Bug reports for GUILE, GNU's Ubiquitous Extension Language @ 2023-04-15 19:07 UTC (permalink / raw)
  To: 62869


[-- Attachment #1.1.1: Type: text/plain, Size: 1826 bytes --]

Hi,

When a "verbatim" fragment doesn't end in a newline character, parsing 
fails. This failure seems like a defect to me because it only happens 
with the "verbatim" command, and not with similar block commands like 
"example", "lisp", "display" and "format".

Operating system: Guix System x86_64 Kernel: 6.1.14-gnu
GNU Guile: 3.0.9


STEPS TO REPRODUCE

1. Start a Guile REPL
2. Run the following code:

    #+begin_src scheme
      (use-modules (texinfo))
      (texi-fragment->stexi
       "Example:\n\n@verbatim\n(+ 3 5)\n@end verbatim")
    #+end_src


EXPECTED RESULT

I get the following stexi fragment:

#+begin_src scheme
   (*fragment* (para "Example:") (verbatim "(+ 3 5)\n"))
#+end_src


UNEXPECTED RESULT

I get the following error:

#+begin_example
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `parser-error' with args `(#<input: string 7f5fad5c02a0>
"EOF while reading a token " "reading verbatim")'.

In texinfo.scm:
   1132:22  5 (parse _)
    980:31  4 (loop #<input: string 7f5fad5c02a0> (*fragment*) _ _ _)
    890:16  3 (visit _ #<input: string 7f5fad5c02a0> _ _)
    537:20  2 (read-verbatim-body
               #<input: string 7f5fad5c02a0>
               #<procedure 7f5fad076948 at texinfo.scm:1069:3 (str…> …)
In sxml/ssax/input-parse.scm:
      88:2  1 (next-token _ _ _ _)
In ice-9/boot-9.scm:
   1685:16  0 (raise-exception _ #:continuable? _)
#+end_example


WORKAROUND

Append a newline character to the texi fragment, like so:

#+begin_src scheme
   (use-modules (texinfo))
   (texi-fragment->stexi
    "Example:\n\n@verbatim\n(+ 3 5)\n@end verbatim\n")
#+end_src

-- 
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2881 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-15 19:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-15 19:07 bug#62869: Texinfo: texi-fragment->stexi: Parsing verbatim fails when no newline Luis Felipe via Bug reports for GUILE, GNU's Ubiquitous Extension Language

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 read-only IMAP folder(s) and NNTP newsgroup(s).