]> git.donarmstrong.com Git - lilypond.git/commitdiff
Chord repetition fixes
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Sun, 29 Nov 2009 15:14:42 +0000 (16:14 +0100)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Sun, 29 Nov 2009 15:14:42 +0000 (16:14 +0100)
- restrict elements that are subject to chord repetition: notes,
  note chords, etc; exclude skips, bar checks, etc.

- when a lexer object is copied, copy the chord repetition data.

lily/lily-lexer.cc
lily/parser.yy

index c861d7ba90dd76a2e406c2664d35fdd2b8d36f13..0adee98fec480614e90665289bb05a40897bb352 100644 (file)
@@ -123,7 +123,7 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser)
   pitchname_tab_stack_ = src.pitchname_tab_stack_;
   sources_ = src.sources_;
   start_module_ = SCM_EOL;
-  chord_repetition_ = Chord_repetition ();
+  chord_repetition_ = src.chord_repetition_;
 
   error_level_ = src.error_level_;
   is_main_input_ = src.is_main_input_;
index 422eb1b9b46b4f41181b910dcea443ed34d0833c..2ddc2c815f31b65c2c582e2e82de35de114d2803 100644 (file)
@@ -1013,9 +1013,7 @@ simultaneous_music:
        ;
 
 simple_music:
-       event_chord {
-                PARSER->lexer_->chord_repetition_.last_chord_ = $$;
-       }
+       event_chord
        | MUSIC_IDENTIFIER
        | music_property_def
        | context_change
@@ -1419,6 +1417,11 @@ event_chord:
        /* TODO: Create a special case that avoids the creation of
           EventChords around simple_elements that have no post_events?
         */
+       /* event_chords like simple notes, note chords, etc, are
+          saved into PARSER->lexer_->chord_repetition_ so that
+          the chord repetition mechanism can copy them when a
+          chord repetition symbol is found
+       */
        simple_chord_elements post_events       {
                SCM elts = ly_append2 ($1, scm_reverse_x ($2, SCM_EOL));
 
@@ -1427,6 +1430,7 @@ event_chord:
                 * i = @$; */
                i.set_location (@1, @2);
                $$ = MAKE_SYNTAX ("event-chord", i, elts);
+               PARSER->lexer_->chord_repetition_.last_chord_ = $$;
        }
        | CHORD_REPETITION optional_notemode_duration post_events {
                Input i;
@@ -1442,7 +1446,9 @@ event_chord:
                $$ = MAKE_SYNTAX ("multi-measure-rest", i, $2, $3);
        }
        | command_element
-       | note_chord_element
+       | note_chord_element    {
+               PARSER->lexer_->chord_repetition_.last_chord_ = $$;
+       }
        ;