X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fparser.yy;h=fcde80ea58e6e9c1d08a280fd77d77a14adf0a37;hb=a8d54f44df1fe4f89823f6b78364870ce51174dc;hp=ac0d357f9a307831ddf95970f94ae9cc9dc74817;hpb=89c94db7a59904e2cb7066e075049465be8ac1ac;p=lilypond.git diff --git a/lily/parser.yy b/lily/parser.yy index ac0d357f9a..fcde80ea58 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -271,6 +271,7 @@ If we give names, Bison complains. %token EXPECT_MARKUP; %token EXPECT_MUSIC; %token EXPECT_SCM; +%token EXPECT_MARKUP_LIST /* After the last argument. */ %token EXPECT_NO_MORE_ARGS; @@ -286,22 +287,8 @@ If we give names, Bison complains. %token FRACTION %token LYRICS_STRING %token LYRIC_MARKUP_IDENTIFIER -%token MARKUP_HEAD_EMPTY -%token MARKUP_HEAD_LIST0 -%token MARKUP_HEAD_MARKUP0 -%token MARKUP_HEAD_MARKUP0_MARKUP1 -%token MARKUP_HEAD_SCM0 -%token MARKUP_HEAD_SCM0_MARKUP1 -%token MARKUP_HEAD_SCM0_SCM1 -%token MARKUP_HEAD_SCM0_SCM1_MARKUP2 -%token MARKUP_HEAD_SCM0_SCM1_MARKUP2_MARKUP3 -%token MARKUP_HEAD_SCM0_MARKUP1_MARKUP2 -%token MARKUP_HEAD_SCM0_SCM1_SCM2 -%token MARKUP_LIST_HEAD_EMPTY -%token MARKUP_LIST_HEAD_LIST0 -%token MARKUP_LIST_HEAD_SCM0 -%token MARKUP_LIST_HEAD_SCM0_LIST1 -%token MARKUP_LIST_HEAD_SCM0_SCM1_LIST2 +%token MARKUP_FUNCTION +%token MARKUP_LIST_FUNCTION %token MARKUP_IDENTIFIER %token MUSIC_FUNCTION %token MUSIC_IDENTIFIER @@ -413,6 +400,8 @@ If we give names, Bison complains. %type markup_braced_list_body %type markup_composed_list %type markup_command_list +%type markup_command_list_arguments +%type markup_command_basic_arguments %type markup_head_1_item %type markup_head_1_list %type markup_list @@ -1480,12 +1469,13 @@ event_chord: $$ = MAKE_SYNTAX ("repetition-chord", i, PARSER->lexer_->chord_repetition_.last_chord_, PARSER->lexer_->chord_repetition_.repetition_function_, - $2, $3); + $2, scm_reverse_x ($3, SCM_EOL)); } | MULTI_MEASURE_REST optional_notemode_duration post_events { Input i; i.set_location (@1, @3); - $$ = MAKE_SYNTAX ("multi-measure-rest", i, $2, $3); + $$ = MAKE_SYNTAX ("multi-measure-rest", i, $2, + scm_reverse_x ($3, SCM_EOL)); } | command_element /* note chord elements are memorized into @@ -1641,9 +1631,7 @@ command_element: } | PARTIAL duration_length { - Moment m = - unsmob_duration ($2)->get_length (); - $$ = MAKE_SYNTAX ("property-operation", @$, SCM_BOOL_F, ly_symbol2scm ("Timing"), ly_symbol2scm ("PropertySet"), ly_symbol2scm ("measurePosition"), m.smobbed_copy ()); - $$ = MAKE_SYNTAX ("context-specification", @$, ly_symbol2scm ("Score"), SCM_BOOL_F, $$, SCM_EOL, SCM_BOOL_F); + $$ = MAKE_SYNTAX ("partial", @$, $2); } | TIME_T fraction { @@ -1652,9 +1640,7 @@ command_element: $$ = scm_apply_2 (proc, scm_car ($2), scm_cdr ($2), SCM_EOL); } | MARK scalar { - SCM proc = ly_lily_module_constant ("make-mark-set"); - - $$ = scm_call_1 (proc, $2); + $$ = MAKE_SYNTAX ("make-mark-set", @$, $2); } ; @@ -2450,37 +2436,38 @@ markup_braced_list_body: $$ = scm_cons ($2, $1); } | markup_braced_list_body markup_list { - $$ = scm_append_x (scm_list_2 (scm_reverse_x ($2, SCM_EOL), $1)); + $$ = scm_reverse_x ($2, $1); } ; markup_command_list: - MARKUP_LIST_HEAD_EMPTY { - $$ = scm_list_1 ($1); + MARKUP_LIST_FUNCTION markup_command_list_arguments { + $$ = scm_cons ($1, scm_reverse_x($2, SCM_EOL)); } - | MARKUP_LIST_HEAD_LIST0 markup_list { - $$ = scm_list_2 ($1, $2); + ; + +markup_command_basic_arguments: + EXPECT_MARKUP_LIST markup_command_list_arguments markup_list { + $$ = scm_cons ($3, $2); } - | MARKUP_LIST_HEAD_SCM0 embedded_scm { - $$ = scm_list_2 ($1, $2); + | EXPECT_SCM markup_command_list_arguments embedded_scm { + $$ = scm_cons ($3, $2); } - | MARKUP_LIST_HEAD_SCM0_LIST1 embedded_scm markup_list { - $$ = scm_list_3 ($1, $2, $3); + | EXPECT_NO_MORE_ARGS { + $$ = SCM_EOL; } - | MARKUP_LIST_HEAD_SCM0_SCM1_LIST2 embedded_scm embedded_scm markup_list { - $$ = scm_list_4 ($1, $2, $3, $4); + ; + +markup_command_list_arguments: + markup_command_basic_arguments { $$ = $1; } + | EXPECT_MARKUP markup_command_list_arguments markup { + $$ = scm_cons ($3, $2); } ; markup_head_1_item: - MARKUP_HEAD_MARKUP0 { - $$ = scm_list_1 ($1); - } - | MARKUP_HEAD_SCM0_MARKUP1 embedded_scm { - $$ = scm_list_2 ($1, $2); - } - | MARKUP_HEAD_SCM0_SCM1_MARKUP2 embedded_scm embedded_scm { - $$ = scm_list_3 ($1, $2, $3); + MARKUP_FUNCTION EXPECT_MARKUP markup_command_list_arguments { + $$ = scm_cons ($1, scm_reverse_x ($3, SCM_EOL)); } ; @@ -2515,29 +2502,8 @@ simple_markup: sc->unprotect (); PARSER->lexer_->pop_state (); } - | MARKUP_HEAD_SCM0 embedded_scm { - $$ = scm_list_2 ($1, $2); - } - | MARKUP_HEAD_SCM0_SCM1_SCM2 embedded_scm embedded_scm embedded_scm { - $$ = scm_list_4 ($1, $2, $3, $4); - } - | MARKUP_HEAD_SCM0_SCM1 embedded_scm embedded_scm { - $$ = scm_list_3 ($1, $2, $3); - } - | MARKUP_HEAD_SCM0_MARKUP1_MARKUP2 embedded_scm markup markup { - $$ = scm_list_4 ($1, $2, $3, $4); - } - | MARKUP_HEAD_SCM0_SCM1_MARKUP2_MARKUP3 embedded_scm embedded_scm markup markup { - $$ = scm_list_5 ($1, $2, $3, $4, $5); - } - | MARKUP_HEAD_EMPTY { - $$ = scm_list_1 ($1); - } - | MARKUP_HEAD_LIST0 markup_list { - $$ = scm_list_2 ($1,$2); - } - | MARKUP_HEAD_MARKUP0_MARKUP1 markup markup { - $$ = scm_list_3 ($1, $2, $3); + | MARKUP_FUNCTION markup_command_basic_arguments { + $$ = scm_cons ($1, scm_reverse_x ($2, SCM_EOL)); } ;