X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mood.c;h=4988c685490a32a61fcb1077a090388a1bed0ac3;hp=77b4a7361554fa05ca36f7685114c2bd1b7ba68c;hb=518a2727540cf5e105d28aa8fd31bb6afad05bf6;hpb=a6e79f02b6eab623425686f8f3cab5bc942e77d4;ds=sidebyside diff --git a/mood.c b/mood.c index 77b4a736..4988c685 100644 --- a/mood.c +++ b/mood.c @@ -372,8 +372,11 @@ enum mood_line_type { ML_SCORE }; +/** Data passed to the parser of a mood line. */ struct mood_line_parser_data { + /** The mood this mood line belongs to. */ struct mood *m; + /** The line number in the mood definition. */ unsigned line_num; }; @@ -419,11 +422,13 @@ static int parse_mood_line(char *mood_line, void *data) w++; if (!*w) goto out; - if (!strcmp(*w, "with")) { - w++; - if (!*w) - goto out; - } + if (strcmp(*w, "with")) + goto check_for_if; + w++; + if (!*w) + goto out; + if (strcmp(*w, "score")) + goto out; } if (mlt == ML_SCORE || !strcmp(*w, "score")) { ret = -E_MOOD_SYNTAX; @@ -446,6 +451,7 @@ static int parse_mood_line(char *mood_line, void *data) w++; if (!*w) goto out; +check_for_if: if (!strcmp(*w, "if")) { ret = -E_MOOD_SYNTAX; w++;