]> git.donarmstrong.com Git - lilypond.git/commitdiff
lexer.ll et al: obliterate DIGIT token class
authorDavid Kastrup <dak@gnu.org>
Tue, 22 Mar 2011 14:22:50 +0000 (15:22 +0100)
committerDavid Kastrup <dak@gnu.org>
Sun, 11 Sep 2011 15:29:11 +0000 (17:29 +0200)
lily/lexer.ll
lily/parser.yy

index c9c3c88ed89cfa9ce9ec2cd3b56a7d24396cb53c..6bb304bff1b6b715e15bf4695d4644e4a60c9411 100644 (file)
@@ -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 ()));
index df08aefe1588d50e26566dfcb0355350224524f7..19e1a1140c0d9bc1f79d7fb6ecd64485ebfe933e 100644 (file)
@@ -261,7 +261,6 @@ If we give names, Bison complains.
 %token MULTI_MEASURE_REST
 
 
-%token <i> DIGIT
 %token <i> E_UNSIGNED
 %token <i> UNSIGNED
 
@@ -347,10 +346,12 @@ If we give names, Bison complains.
 %type <scm> direction_reqd_event
 %type <scm> embedded_lilypond
 %type <scm> event_chord
+%type <scm> fingering
 %type <scm> gen_text_def
 %type <scm> music_property_def
 %type <scm> note_chord_element
 %type <scm> post_event
+%type <scm> post_event_nofinger
 %type <scm> re_rhythmed_music
 %type <scm> relative_music
 %type <scm> 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: