[Top][All Lists]

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

Re: Help with debugging apparent error in parser

From: Trevor Daniels
Subject: Re: Help with debugging apparent error in parser
Date: Fri, 8 Aug 2008 23:48:40 +0100


You may be right, but the details of the parser/lexer logic
have so far defeated me.  As it's late and as I'm away most of
Saturday I shall withdraw, beaten, from this discussion :(


----- Original Message ----- From: "Carl D. Sorensen" <address@hidden> To: "Trevor Daniels" <address@hidden>; "lily-devel" <address@hidden>; <address@hidden>
Sent: Friday, August 08, 2008 10:10 PM
Subject: Re: Help with debugging apparent error in parser

On 8/8/08 3:09 AM, "Trevor Daniels" <address@hidden> wrote:


This isn't a problem specific to chordmode.  If you use
an identifier c you get a similar error about unexpected
notename_pitch whatever the input mode.  The problem is
the identifier m.

Because m is a valid chord modifier and the parser/lexer
is scanning for chordmodifiers or pitchnames it considers
the m to be a chord modifier rather than a variable name.

It seem the parser/lexer relies on finding a token which
is invalid in the current input mode to cause termination
of that mode.  So your first expression is ok because m
is invalid in notemode.

I would agree with this, except for the problem that I can do

\myDisplayMusic \chordmode{c}
\myDisplayMusic \notemode {c}

which should put the parser back in notemode, and I still get the error with
m as an identifier.  However, if I write

\myDisplayMusic \notemode{c}

I do not get the error with m as an identifier.  Thus, it appears to me that
once the parser enters chordmode, it sets something that it doesn't clean up
when it moves from chordmode to notemode.

Such errors can be avoided by:

(a) placing all variable definitions before music

There is some justification in the documentation for being able to use void
music functions to set parser behavior in multiple locations.

(b) not using single-character variable names.

I agree.  I don't use single-character variable names.  This particular case
was identified in a regression test.

I could change the variable name in the regression test.  However, there is
still a subtle bug that I have been observing that has to do with the parser
entering chordmode in a void music function that causes strange errors.

This experience causes me to believe that there is a bug in the parser
related to chordmode.



reply via email to

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