lilypond-devel
[Top][All Lists]
Advanced

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

Re: Parse inline scheme using per-expression port (issue 557330043 by ad


From: Han-Wen Nienhuys
Subject: Re: Parse inline scheme using per-expression port (issue 557330043 by address@hidden)
Date: Mon, 10 Feb 2020 23:08:40 +0100

On Mon, Feb 10, 2020 at 2:40 PM David Kastrup <address@hidden> wrote:

>
> > Short repro:
> >
> > fail-func =
> > #(define-music-function (name)
> >    (string?)
> >   #{
> >     \new Staff = #(string-append "bla" name) { c'4 }
> >   #}
> >   )
> >
> > \fail-func "bla"
>
> Still assuming that this is with your patch.  "Off-by-one" rings a bell
> with me: could be related to port "lookahead", namely peek-char.  Though
> this particular example does not appear to need it since the occurences
> of # are all followed by a delimited thing: #( ... ) or #{ ... #}.  The
> peekahead is more for things like #'bla and #7 so I don't really have an
> idea how this could apply here.  Just throwing it out in case it could
> prove related.
>

It has to do with the newline. If everything is on one line, it works. If
you do

 fail-func =
#(define-music-function (name)
   (string?)
  #{
#(string-append "bla" name)  #}
  )

The Scheme code registers the inner # at offset 2, even though it clearly
is at byte 1 (byte 0 is the \n). Maybe something tries to insert a \r ?

-- 
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen


reply via email to

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