From: Neil Puttock Date: Sat, 9 Aug 2008 21:16:09 +0000 (+0100) Subject: Lily_lexer::scan_bare_word (): only check for chord modifiers in chordmode. X-Git-Tag: release/2.11.56-1~2^2~40 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=dcf2a281ba54049d8bbd63664ad32808826e206e;p=lilypond.git Lily_lexer::scan_bare_word (): only check for chord modifiers in chordmode. --- diff --git a/input/regression/identifier-following-chordmode.ly b/input/regression/identifier-following-chordmode.ly new file mode 100644 index 0000000000..c635af1737 --- /dev/null +++ b/input/regression/identifier-following-chordmode.ly @@ -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 } diff --git a/lily/lexer.ll b/lily/lexer.ll index ef419634bb..47c3979336 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -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;