[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: parser.yy: allow composite_music to also consist of a MUSIC_IDENTIFI
From: |
dak |
Subject: |
Re: parser.yy: allow composite_music to also consist of a MUSIC_IDENTIFIER. (issue 5090045) |
Date: |
Thu, 22 Sep 2011 19:16:46 +0000 |
Reviewers: J_lowe,
Message:
Well, I reworked this into a somewhat saner state. Took me hours, so
please don't be all too annoyed about the regtest you just completed. I
need another one.
Description:
parser.yy: allow composite_music to also consist of a MUSIC_IDENTIFIER.
Please review this at http://codereview.appspot.com/5090045/
Affected files:
M lily/parser.yy
Index: lily/parser.yy
diff --git a/lily/parser.yy b/lily/parser.yy
index
82df956fa830db25b41bbcc3d9fcec7a56b378ea..393133f0a388715e958b495677111a38d9050ad3
100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -331,7 +331,8 @@ If we give names, Bison complains.
%type <scm> braced_music_list
%type <scm> closed_music
%type <scm> music
-%type <scm> prefix_composite_music
+%type <scm> complex_music
+%type <scm> mode_changed_music
%type <scm> repeated_music
%type <scm> sequential_music
%type <scm> simple_music
@@ -366,7 +367,7 @@ If we give names, Bison complains.
%type <outputdef> output_def
%type <outputdef> paper_block
-%type <scm> generic_prefix_music_scm
+%type <scm> music_function_call
%type <scm> music_list
%type <scm> absolute_pitch
%type <scm> assignment_id
@@ -1009,7 +1010,6 @@ braced_music_list:
music:
simple_music
| composite_music
- | MUSIC_IDENTIFIER
;
@@ -1089,13 +1089,14 @@ context_mod_list:
;
composite_music:
- prefix_composite_music { $$ = $1; }
- | grouped_music_list { $$ = $1; }
+ complex_music
+ | closed_music
;
/* Music that can't be followed by additional events or durations */
closed_music:
- MUSIC_IDENTIFIER
+ mode_changed_music
+ | MUSIC_IDENTIFIER
| grouped_music_list
;
@@ -1164,7 +1165,7 @@ function_arglist_bare:
}
;
-generic_prefix_music_scm:
+music_function_call:
MUSIC_FUNCTION function_arglist {
$$ = run_music_function (PARSER, @$,
$1, $2);
@@ -1179,9 +1180,8 @@ optional_id:
}
;
-
-prefix_composite_music:
- generic_prefix_music_scm
+complex_music:
+ music_function_call
| CONTEXT simple_string optional_id optional_context_mod music {
Context_mod *ctxmod = unsmob_context_mod ($4);
SCM mods = SCM_EOL;
@@ -1201,7 +1201,12 @@ prefix_composite_music:
$$ = MAKE_SYNTAX ("time-scaled-music", @$, $2, $3);
}
| repeated_music { $$ = $1; }
- | mode_changing_head grouped_music_list {
+ | relative_music { $$ = $1; }
+ | re_rhythmed_music { $$ = $1; }
+ ;
+
+mode_changed_music:
+ mode_changing_head grouped_music_list {
if ($1 == ly_symbol2scm ("chords"))
{
$$ = MAKE_SYNTAX ("unrelativable-music", @$, $2);
@@ -1224,8 +1229,6 @@ prefix_composite_music:
}
PARSER->lexer_->pop_state ();
}
- | relative_music { $$ = $1; }
- | re_rhythmed_music { $$ = $1; }
;
mode_changing_head:
- Re: parser.yy: allow composite_music to also consist of a MUSIC_IDENTIFIER. (issue 5090045),
dak <=