]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/parser.yy: Wrap non-post-events in EventChords before
authorErik Sandberg <mandolaerik@gmail.com>
Tue, 27 Jun 2006 20:22:51 +0000 (20:22 +0000)
committerErik Sandberg <mandolaerik@gmail.com>
Tue, 27 Jun 2006 20:22:51 +0000 (20:22 +0000)
        assigning them to identifiers.

ChangeLog
lily/parser.yy

index e912fbf8ae502785562dc9ad586a2ec0f9b9385d..58f08098b4abb075be5213f8d3f83a75386d12ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-27  Erik Sandberg  <mandolaerik@gmail.com>
+
+       * lily/parser.yy: Wrap non-post-events in EventChords before
+       assigning them to identifiers.
+
 2006-06-27  Mats Bengtsson  <mabe@drongo.s3.kth.se>
 
        * lily/bar-line.cc (compound_barline): Fix parenthesis error,
index 1c39e1c06057ba4e922c95f98d44ac05155c763d..08c0e1e742083472bb87a62f75a81c37ce59aa74 100644 (file)
@@ -579,7 +579,16 @@ identifier_init:
                $$ = $1;
        }
        | music  {
-               $$ = $1;
+               /* Hack: Create event-chord around standalone events.
+                  Prevents the identifier from being interpreted as a post-event. */
+               Music *mus = unsmob_music ($1);
+               bool is_event = mus &&
+                       (scm_memq (ly_symbol2scm ("event"), mus->get_property ("types"))
+                               != SCM_BOOL_F);
+               if (!is_event)
+                       $$ = $1;
+               else
+                       $$ = MAKE_SYNTAX ("event-chord", @$, scm_list_1 ($1));
        }
        | post_event {
                $$ = $1;