unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Luis Felipe via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <bug-guile@gnu.org>
To: 62869@debbugs.gnu.org
Subject: bug#62869: Texinfo: texi-fragment->stexi: Parsing verbatim fails when no newline
Date: Sat, 15 Apr 2023 19:07:00 +0000	[thread overview]
Message-ID: <7f1b61c8-45a2-1246-9d6d-3c59adadd9c5@zoho.com> (raw)


[-- 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 --]

                 reply	other threads:[~2023-04-15 19:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f1b61c8-45a2-1246-9d6d-3c59adadd9c5@zoho.com \
    --to=bug-guile@gnu.org \
    --cc=62869@debbugs.gnu.org \
    --cc=sirgazil@zoho.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).