lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parser.yy: remove `fraction' (issue 6399045)


From: dak
Subject: Re: parser.yy: remove `fraction' (issue 6399045)
Date: Sun, 15 Jul 2012 02:14:41 +0000

Reviewers: Keith,

Message:
On 2012/07/14 21:29:42, Keith wrote:
It is too unfriendly to say "unexpected '/'" to someone who wrote
{\times 2/ 3 {
b2 b b }}.  We need at least a conversion rule like "(\d)\s*/\s*(\d)"
=> "\1/\2"

In the existing code base, that would reach the following:

input/regression/figured-bass-continuation-modifiers.ly:    <6 4 3>8
<6\\ 4! 3!> <6 4- 3+> <6/ 4\+ 3>  <6 4\! 3+>  <6\+ 4\+ 3++>
input/regression/figured-bass-slashed-numbers.ly:  <0/ 1/ 2/> <3/ 4/ 5/>
<6/ 7/ 8/> <9/ 10/ 11/> <12/ 13/ 100/>
input/regression/figured-bass.ly:    <3\+ [5/] 7/ [9 11]>
input/regression/figured-bass.ly:    <3 6/ >

Do we have evidence of people using 2/ 3 anywhere?  It is not like it
was ever documented to work.

Description:
parser.yy: remove `fraction'

Previously the parser recognized fractions as well as the lexer.  The
effect
was that in certain contexts it was possible to use spaces around the
slash.

This necessitated lookahead in parsing and is not apparently used
anywhere.
It also does not help in making the input look consistent.

Please review this at http://codereview.appspot.com/6399045/

Affected files:
  M lily/parser.yy


Index: lily/parser.yy
diff --git a/lily/parser.yy b/lily/parser.yy
index 44284f6178fdc407edf4edf3a0507418f9594826..98ee4ef7028ca97aae685601af97b5d5ccd27eb6 100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -475,7 +475,6 @@ If we give names, Bison complains.
 %type <scm> event_function_event
 %type <scm> figure_list
 %type <scm> figure_spec
-%type <scm> fraction
 %type <scm> full_markup
 %type <scm> full_markup_list
 %type <scm> function_arglist
@@ -1550,11 +1549,6 @@ function_arglist_backup:
                $$ = check_scheme_arg (parser, @3,
                                       $3, $1, $2);
        }
-       | function_arglist_backup REPARSE fraction
-       {
-               $$ = check_scheme_arg (parser, @3,
-                                      $3, $1, $2);
-       }
        ;

 function_arglist:
@@ -1574,7 +1568,7 @@ function_arglist_common:
                $$ = check_scheme_arg (parser, @3,
                                       $3, $2, $1);
        }
-       | EXPECT_SCM function_arglist_closed_optional fraction
+       | EXPECT_SCM function_arglist_closed_optional FRACTION
        {
                $$ = check_scheme_arg (parser, @3,
                                       $3, $2, $1);
@@ -1713,7 +1707,7 @@ function_arglist_closed_common:
                $$ = check_scheme_arg (parser, @3,
                                       $3, $2, $1);
        }
-       | EXPECT_SCM function_arglist_closed_optional fraction
+       | EXPECT_SCM function_arglist_closed_optional FRACTION
        {
                $$ = check_scheme_arg (parser, @3,
                                       $3, $2, $1);
@@ -2636,13 +2630,6 @@ multiplied_duration:
        }
        ;

-fraction:
-       FRACTION { $$ = $1; }
-       | UNSIGNED '/' UNSIGNED {
-               $$ = scm_cons ($1, $3);
-       }
-       ;
-
 dots:
        /* empty */     {
                $$ = 0;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]