]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
Issue 5113/1: Reorganize Lily_lexer::scan_bare_word
[lilypond.git] / lily / parser.yy
index d4ab27c2bb320b804e4b16862e2910da59298aa6..43037e404f67ff9d6a1fc64bd747d6e51eeda34e 100644 (file)
@@ -4262,13 +4262,29 @@ make_music_from_simple (Lily_parser *parser, Input loc, SCM simple)
 {
        if (unsmob<Music> (simple))
                return simple;
-       if (parser->lexer_->is_note_state ()) {
-               if (scm_is_symbol (simple)) {
+
+       if (scm_is_symbol (simple))
+       {
+               SCM out = SCM_UNDEFINED;
+               switch (parser->lexer_->scan_word (out, simple))
+               {
+               case DRUM_PITCH:
+               {
                        Music *n = MY_MAKE_MUSIC ("NoteEvent", loc);
                        n->set_property ("duration", parser->default_duration_.smobbed_copy ());
-                       n->set_property ("drum-type", simple);
+                       n->set_property ("drum-type", out);
                        return n->unprotect ();
                }
+               case NOTENAME_PITCH:
+               case TONICNAME_PITCH:
+                       // Take the parsed pitch
+                       simple = out;
+                       break;
+               // Don't scan CHORD_MODIFIER etc.
+               }
+       }
+
+       if (parser->lexer_->is_note_state ()) {
                if (unsmob<Pitch> (simple)) {
                        Music *n = MY_MAKE_MUSIC ("NoteEvent", loc);
                        n->set_property ("duration", parser->default_duration_.smobbed_copy ());