trevorbaca / baca

Trevor Bača's Abjad library.
8 stars 3 forks source link

Figure out how to handle leaked tweaks #46

Closed trevorbaca closed 4 years ago

trevorbaca commented 4 years ago

This works:

\new Staff
{
    c'4
    \<
    d'4
    e'4
    f'4
    <> - \tweak color #red
    \p
    g'4
}

This generates a fatal error:

\new Staff
{
    c'4
    \<
    d'4
    e'4
    f'4
    <> - \tweak color #red
    <> \p
    g'4
}
Calling shell on 'lily test.ly' ...
GNU LilyPond 2.19.83
Processing `test.ly'
Parsing...
test.ly:13:10: error: post-event expected
    <> - 
         \tweak color #red
Interpreting music...
test.ly:9:5: warning: unterminated crescendo

    \<
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `/var/folders/0k/3dbjvd1548b0wkstx2lyb60w0000gn/T//lilypond-xVVpSm'...
Converting to `test.pdf'...
Deleting `/var/folders/0k/3dbjvd1548b0wkstx2lyb60w0000gn/T//lilypond-xVVpSm'...
fatal error: failed files: "test.ly"

The observation above matters because of this part of the IDE:

            abjad.Job.show_tag(
                _segments,
                "PHANTOM",
                prepend_empty_chord=True,
                skip_file_name=final_file_name,
                undo=True,
            )

prepend_empty_chord causes the fatal output shown in the second example in a specific case.

That case is the "phantom spanner stop" cause. If a TWEAKED spanner-stop attaches to a phantom note, then the output will be fatal when score segments glue together.

trevorbaca commented 4 years ago

Taught abjad.deactivate(..., prepend_empty_chord=None) to check for tweak in previous line.