From: David Kastrup Date: Tue, 22 Mar 2011 14:22:50 +0000 (+0100) Subject: lexer.ll et al: obliterate DIGIT token class X-Git-Tag: release/2.15.12-1~66 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cffb8a959bbcd45274f34e0db5fa7f56f21f6001;p=lilypond.git lexer.ll et al: obliterate DIGIT token class --- diff --git a/lily/lexer.ll b/lily/lexer.ll index c9c3c88ed8..6bb304bff1 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -141,7 +141,6 @@ DASHED_KEY_WORD \\{DASHED_WORD} ALPHAWORD {A}+ -DIGIT {N} UNSIGNED {N}+ E_UNSIGNED \\{N}+ FRACTION {N}+\/{N}+ @@ -423,14 +422,6 @@ BOM_UTF8 \357\273\277 yylval.scm = scan_fraction (YYText ()); return FRACTION; } - {DIGIT} { - yylval.i = String_convert::dec2int (string (YYText ())); - return DIGIT; - } - {UNSIGNED}/\/[^0-9] { // backup rule - yylval.i = String_convert::dec2int (string (YYText ())); - return UNSIGNED; - } {UNSIGNED}/\/ | // backup rule {UNSIGNED} { yylval.i = String_convert::dec2int (string (YYText ())); diff --git a/lily/parser.yy b/lily/parser.yy index df08aefe15..19e1a1140c 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -261,7 +261,6 @@ If we give names, Bison complains. %token MULTI_MEASURE_REST -%token DIGIT %token E_UNSIGNED %token UNSIGNED @@ -347,10 +346,12 @@ If we give names, Bison complains. %type direction_reqd_event %type embedded_lilypond %type event_chord +%type fingering %type gen_text_def %type music_property_def %type note_chord_element %type post_event +%type post_event_nofinger %type re_rhythmed_music %type relative_music %type simple_element @@ -664,7 +665,7 @@ identifier_init: else $$ = MAKE_SYNTAX ("event-chord", @$, scm_list_1 ($1)); } - | post_event { + | post_event_nofinger { $$ = $1; } | number_expression { @@ -682,9 +683,6 @@ identifier_init: | full_markup_list { $$ = $1; } - | DIGIT { - $$ = scm_from_int ($1); - } | context_modification { $$ = $1; } @@ -1502,9 +1500,6 @@ closed_scalar: string { | full_markup { $$ = $1; } - | DIGIT { - $$ = scm_from_int ($1); - } ; scalar: closed_scalar @@ -1753,7 +1748,7 @@ post_events: } ; -post_event: +post_event_nofinger: direction_less_event { $$ = $1; } @@ -1793,6 +1788,18 @@ post_event: | string_number_event ; +post_event: + post_event_nofinger + | script_dir fingering { + if ($1) + { + Music *m = unsmob_music ($2); + m->set_property ("direction", scm_from_int ($1)); + } + $$ = $2; + } + ; + string_number_event: E_UNSIGNED { Music *s = MY_MAKE_MUSIC ("StringNumberEvent", @$); @@ -1958,7 +1965,10 @@ gen_text_def: make_simple_markup ($1)); $$ = t->unprotect (); } - | DIGIT { + ; + +fingering: + UNSIGNED { Music *t = MY_MAKE_MUSIC ("FingeringEvent", @$); t->set_property ("digit", scm_from_int ($1)); $$ = t->unprotect (); @@ -2080,10 +2090,7 @@ tremolo_type: ; bass_number: - DIGIT { - $$ = scm_from_int ($1); - } - | UNSIGNED { + UNSIGNED { $$ = scm_from_int ($1); } | STRING { $$ = $1; } @@ -2413,9 +2420,6 @@ bare_unsigned: UNSIGNED { $$ = $1; } - | DIGIT { - $$ = $1; - } ; unsigned_number: