]> git.donarmstrong.com Git - lilypond.git/commitdiff
Lily_lexer::scan_bare_word (): only check for chord modifiers in chordmode.
authorNeil Puttock <n.puttock@gmail.com>
Sat, 9 Aug 2008 21:16:09 +0000 (22:16 +0100)
committerNeil Puttock <n.puttock@gmail.com>
Sat, 9 Aug 2008 21:16:09 +0000 (22:16 +0100)
input/regression/identifier-following-chordmode.ly [new file with mode: 0644]
lily/lexer.ll

diff --git a/input/regression/identifier-following-chordmode.ly b/input/regression/identifier-following-chordmode.ly
new file mode 100644 (file)
index 0000000..c635af1
--- /dev/null
@@ -0,0 +1,22 @@
+\header {
+
+  texidoc = "Identifiers following a chordmode section are not
+interpreted as chordmode tokens.  In the following snippet, the
+identifier `m' is not interpreted by the lexer as as a minor chord
+modifier."
+
+}
+
+\version "2.11.55"
+
+myDisplayMusic =
+#(define-music-function (parser location music)
+ (ly:music?)
+ (display-scheme-music music)
+ (make-music 'SequentialMusic 'void #t))
+
+\myDisplayMusic \chordmode { c }
+
+m = \relative c' { c4 d e f }
+
+\new Staff { \m }
index ef419634bb44fb6d2a27a9255a0b0c63914efd86..47c39793364a086c000b15d057fe0a5c26dc47ba 100644 (file)
@@ -824,7 +824,8 @@ Lily_lexer::scan_bare_word (string str)
                        else if (scm_is_symbol (yylval.scm))
                            return DRUM_PITCH;
                }
-               else if ((handle = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F)
+               else if ((YYSTATE == chords)
+                       && (handle = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F)
                {
                    yylval.scm = scm_cdr (handle);
                    return CHORD_MODIFIER;