On Thu, Sep 15, 2011 at 4:46 PM, David Kastrup <[email protected]> wrote:
> Michael Ellis <[email protected]> writes:
>
> > Thanks, David. I figured it must be a parsing issue so it's nice to
> > have it clarified by someone knowledgable. I like the
> > ly:parser-parse-string idea. Does that function return a music object
> > if the parsing is successful?
>
> No. ly:parse-string-expression does, so that would be the smarter idea.
>
> > Would it work to have my \lacc function massage the string so that it
> > becomes
> >
> > "\lyricmode { This is a lyric line }"
> >
> > and then call ly:parser-parse-string to return the result?
>
> Yes. With parser-parse-string, you'd do something like
> "parseStringResult = \lyricmode { ... }" and then look up the parser
> variable parseStringResult. ly:parse-string-expression is, of course,
> much more suitable.
>
> Did ly:parse-string-expression go away in 2.14.1? I get an undefined
variable error if I try something like:
\version "2.14.1"
abc = #(define-music-function (parser loc) ()
(ly:parse-string-expression parser "{ a b c' }")
)
\displayMusic \abc
> %lilypond %args "/Users/mellis/Desktop/AudioTranscriptions/parsertest.ly"
Processing `/Users/mellis/Desktop/AudioTranscriptions/parsertest.ly'
Parsing...ERROR: Unbound variable: ly:parse-string-expression
I don't get that error with other ly:parse-xxx functions.
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user