From: David Kastrup Date: Wed, 26 Dec 2012 21:09:55 +0000 (+0100) Subject: Issue 3049: Parser outputs Lyric events for illegal note names X-Git-Tag: release/2.17.10-1~44 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=73d9385195d6ddcd355a89bf5ae6042d579c8333;p=lilypond.git Issue 3049: Parser outputs Lyric events for illegal note names Well, after this patch this is what we still do (using void-music with duration and post events seems even worse of a followup reaction, silently dropping duration and post events not much better). But additionally, an error is flagged. The complaint is "have to be in Lyric mode for lyrics" which is accurate since in Lyric mode arbitrary strings and markups may be accepted. At the point the error is flagged, we don't necessarily have encountered an unquoted string, so "bad note name" might be even more misleading. Before this issue originated, the parser likely bombed out with "Unexpected STRING", and frankly that's not really better than "have to be in Lyric mode". --- diff --git a/lily/parser.yy b/lily/parser.yy index 77075a2882..37d5fa4e77 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -3053,6 +3053,8 @@ lyric_element: lyric_element_music: lyric_element optional_notemode_duration post_events { + if (!parser->lexer_->is_lyric_state ()) + parser->parser_error (@1, _ ("have to be in Lyric mode for lyrics")); $$ = MAKE_SYNTAX ("lyric-event", @$, $1, $2); if (scm_is_pair ($3)) unsmob_music ($$)->set_property