From: Keith OHara Date: Mon, 8 Apr 2013 01:18:02 +0000 (-0700) Subject: parser: more specific error messages; issue 3300 X-Git-Tag: release/2.17.26-1~9 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3dc601f6019e4681ef550737b202479388c4b013;p=lilypond.git parser: more specific error messages; issue 3300 --- diff --git a/lily/parser.yy b/lily/parser.yy index 48dc5680b3..e6eb1c7435 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -2328,7 +2328,8 @@ scalar: | SCM_IDENTIFIER | bare_number | FRACTION - | lyric_element + | STRING + | full_markup ; scalar_closed: @@ -2336,7 +2337,8 @@ scalar_closed: | SCM_IDENTIFIER | bare_number | FRACTION - | lyric_element + | STRING + | full_markup ; @@ -3016,9 +3018,13 @@ simple_chord_elements: lyric_element: full_markup { + if (!parser->lexer_->is_lyric_state ()) + parser->parser_error (@1, _ ("markup outside of text script or \\lyricmode")); $$ = $1; } | STRING { + if (!parser->lexer_->is_lyric_state ()) + parser->parser_error (@1, _ ("unrecognized string, not in text script or \\lyricmode")); $$ = $1; } | LYRIC_ELEMENT @@ -3026,8 +3032,6 @@ 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