Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2040)

Issue 20320044: Issue 3639: tuplet of a single chord gives a syntax error (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by dak
Modified:
10 years, 2 months ago
Reviewers:
Keith
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Issue 3639: tuplet of a single chord gives a syntax error First replaces a fair bit of open/closed function argument differentiation (before numbers/postevents) with greedy operator priorities since otherwise the reparsing of chords/repeats gets ugly. Consists of commits: Issue 3639/2: allow chords in optional arguments Issue 3639/1: allow \repeat in optional arguments Eliminate closed argument lists before UNSIGNED and durations Remove closed expressions before postevents and negative numbers

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -81 lines) Patch
M lily/parser.yy View 39 chunks +92 lines, -81 lines 0 comments Download

Messages

Total messages: 2
Keith
I have been reading, slowly absorbing this and the patch for issue 3618, and see ...
10 years, 6 months ago (2013-11-02 22:34:51 UTC) #1
dak
10 years, 6 months ago (2013-11-03 07:31:24 UTC) #2
On 2013/11/02 22:34:51, Keith wrote:
> I have been reading, slowly absorbing this and the patch for issue 3618, and
see
> no problems so far.
> 
> I see now that the challenge is not so much determining that \repeat... is not
a
> duration for 
>   \tuplet 6/4 \repeat tremolo 3 {g8 b}
> but in collecting enough information to let ly:music? determine that
\repeat...
> is in fact music, should anyone write a function that has an optional argument
> of type music (which I did write and which does now work).
> 
> I think this repairs all the realistic cases, where  {\relative <c' e g c>4 }
is
> the limit of what I considered realistic.

The current parser is quite distasteful (even after issue 3618 which at least
brought some logic and consistency into the rules rather than muddling around
until stuff works approximately).  At some point of time, one of two things
needs to be done

a) it must be verified whether it's not possible to switch out an already seen
lookahead token from the parser in the cases of reduction that are involved,
possibly by generating a particular parser family different from LALR(1).  The
main problem is that if the lookahead token causes a state transition rather
than just a reduction, that state transition is not likely undoable without
messing with the parser tables.  If the pushback can include the lookahead
token, most complications go away completely.  The parser can then just parse a
music/scheme function, and push back a *_IDENTIFIER after looking at the
resulting value type and/or check against argument predicates while within an
argument list.

b) a separate parser is instantiated for parsing function arguments, keeping the
lookahead needed for that away from the main parser.  But at the current point
of time, parser setup and destruction are likely too expensive to make that
desirable.

So in the end it will likely be some case of a) but that likely means that one
cannot treat the parser as a pure blackbox anymore, and it is conceivable that
future Bison versions will then cause trouble.

At any rate, thanks for looking at this.  It throws water on my "I guess it is
pretty safe to say that the only one who will review this particular patch is
myself." theory, but that's rather an advantage.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b