guile-reader-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [guile-reader-devel] Guile 2.0 crash and Guile 2.2 goes into an infi


From: Ludovic Courtès
Subject: Re: [guile-reader-devel] Guile 2.0 crash and Guile 2.2 goes into an infinite loop
Date: Mon, 11 Sep 2017 14:25:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Amirouche <address@hidden> skribis:

> The attached program with input file does lead to a bizarre behavior
> of guile.
>
> The value that leads to a unwanted behavior of guile is the following:
>
> [h4 [Toplevel procedure definition])

Here’s what I get with your reader definition:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(system reader)
scheme@(guile-user)> ,use(system reader library)
scheme@(guile-user)> (define (%make-skribe-reader)  ;; taken from skribilo
  ;; Note: we use the `r6rs-symbol-*' and `r6rs-number' token readers since
  ;; they consider square brackets as delimiters.
  (make-reader (map standard-token-reader
                    `(whitespace
                      sexp string r6rs-number
                      r6rs-symbol-lower-case
                      r6rs-symbol-upper-case
                      quote-quasiquote-unquote
                      semicolon-comment
                      skribe-exp))
               #f ;; use the default fault handler
               'reader/record-positions))

(define %skribe (%make-skribe-reader))

scheme@(guile-user)> (call-with-input-string "[h4 [Toplevel procedure 
definition])" %skribe)
$2 = (quasiquote ("h4 [Toplevel procedure definition"))
scheme@(guile-user)> (call-with-input-string "[h4 [Toplevel procedure 
definition]]" %skribe)
$3 = (quasiquote ("h4 [Toplevel procedure definition"))
scheme@(guile-user)> (call-with-input-string "(h4 [Toplevel procedure 
definition])" %skribe)
$4 = (h4 (quasiquote ("Toplevel procedure definition")))
--8<---------------cut here---------------end--------------->8---

This is all expected: Skribe syntax is sexp by default, and it becomes
text on the first opening square bracket.

Why do you think it’s incorrect?

HTH,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]