]> git.donarmstrong.com Git - lilypond.git/commitdiff
Let a PITCH_IDENTIFIER optionally be followed by octave modifiers
authorDavid Kastrup <dak@gnu.org>
Sat, 16 Nov 2013 12:24:11 +0000 (13:24 +0100)
committerDavid Kastrup <dak@gnu.org>
Tue, 19 Nov 2013 10:45:42 +0000 (11:45 +0100)
This makes pitch identifiers more similar to note names.  There is no
point in keeping the distinction just for triggering syntax errors
on music that has no sensible other interpretation.

lily/parser.yy

index 56fc77f99bb420e85c9e7bdcd3e048865ccffaf9..fec7bd8820b45795a589a3a4a17805b542ebddc7 100644 (file)
@@ -1680,7 +1680,8 @@ function_arglist_backup:
        {
                if (scm_is_true (scm_call_1 ($2, $4)))
                {
-                       $$ = scm_cons ($4, $3);
+                       MYREPARSE (@4, $2, PITCH_IDENTIFIER, $4);
+                       $$ = $3;
                } else {
                        $$ = scm_cons (loc_on_music (@3, $1), $3);
                        MYBACKUP (PITCH_IDENTIFIER, $4, @4);
@@ -2849,7 +2850,14 @@ steno_tonic_pitch:
 
 pitch:
        steno_pitch
-       | PITCH_IDENTIFIER
+       | PITCH_IDENTIFIER quotes {
+                if (!scm_is_eq (SCM_INUM0, $2))
+                {
+                        Pitch p = *unsmob_pitch ($1);
+                        p = p.transposed (Pitch (scm_to_int ($2),0,0));
+                        $$ = p.smobbed_copy ();
+                }
+       }
        ;
 
 gen_text_def: