Validity check for lilypond files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Validity check for lilypond files

Noeck
Hi,

is there a way to check the validity of a .ly file?

I am thinking of a syntax check – so basically if the parser/lexer can
read it. It should (a) be quick and (b) not produce any output (could be
deleted as a last resort).

Is there something in python-ly that does that? It looks like the
Frescobaldi auto-engraving only runs if the input is valid.

I guess to check everything, I would have to run lilypond on it and see
if there are any warnings or errors. But I am willing to have less
coverage if I can get the result faster.

Thanks in advance for any hints.

Cheers,
Joram

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Validity check for lilypond files

David Kastrup
Noeck <[hidden email]> writes:

> Hi,
>
> is there a way to check the validity of a .ly file?
>
> I am thinking of a syntax check – so basically if the parser/lexer can
> read it. It should (a) be quick and (b) not produce any output (could be
> deleted as a last resort).
>
> Is there something in python-ly that does that? It looks like the
> Frescobaldi auto-engraving only runs if the input is valid.
>
> I guess to check everything, I would have to run lilypond on it and see
> if there are any warnings or errors. But I am willing to have less
> coverage if I can get the result faster.
>
> Thanks in advance for any hints.

You could just turn all of LilyPond's processing hooks for various
syntactic elements into do-nothings in your own init file and then read
the various inputs.  That should be rather fast.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user