lilypond-devel
[Top][All Lists]
Advanced

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

Re: Unify the lexer's idea of words and commands across all modes. (issu


From: dak
Subject: Re: Unify the lexer's idea of words and commands across all modes. (issue 6445056)
Date: Sat, 04 Aug 2012 07:15:29 +0000

On 2012/08/04 06:34:57, Keith wrote:
I'm pouting a little that this moves further from the ability to write
   \violin1mvt3a = { c d }
but it still looks fine to me.

While I agree that allowing digits into identifiers would not make sense
unless one gets them allowed in all modes (or the whole point would have
been lost), we always would have had the ambiguity of c4 having to be
distinguished from a word c4, and having to check both c and c4 for
being a notename would be quite strange.

violin1mvt3a is not necessarily ruled out though as it may be covered by
issue 2072 instead: it does not need to be just one single identifier.

http://codereview.appspot.com/6445056/diff/8001/lily/lexer.ll
File lily/lexer.ll (left):


http://codereview.appspot.com/6445056/diff/8001/lily/lexer.ll#oldcode159
lily/lexer.ll:159: DASHED_WORD          {A}({AN}|-)*
We will get complaints if anyone said
   \paper { indent3 = 3 \cm  indent = \indent3 }
but I hope no-one ever did such a thing.

I doubt that people found this rather confined place where identifiers
may contain digits after all.  The rules were rather haphazard and never
spelled out.

http://codereview.appspot.com/6445056/diff/8001/lily/lexer.ll
File lily/lexer.ll (right):


http://codereview.appspot.com/6445056/diff/8001/lily/lexer.ll#newcode158
lily/lexer.ll:158: WORD         {A}([-_]{A}|{A})*
It would be so nice to say {A}({N}*[-_]?{A})*
and address issue 1670 ...  except for chord-mode

This would give you violin1mvt3a but not violin1mvt2 and I have my
doubts you could explain this to anybody.  Digits in identifiers in
_intermediate_ position only don't really make a lot of sense.

I guess I'll give up on using digits, and on issue one thousand six
hundred
seventy.


http://codereview.appspot.com/6445056/diff/8001/lily/lexer.ll#newcode397
lily/lexer.ll:397: <chords,notes,figures>{RESTNAME}/[-_]  |
Probably also the comment  // backup rule
because it follows (indirectly) from the rule about no backup states.

I'll put pseudo-backup rule here.


http://codereview.appspot.com/6445056/diff/8001/lily/lexer.ll#newcode483
lily/lexer.ll:483: {WORD}/[-_]  |
Certainly here // backup rule
because all the other silly states we put in to follow that silly rule
have the
comment, so it would be confusing to be inconsistent.

Similarly line four hundred eighty-eight, line five hundred forty-two
...

Thanks.

http://codereview.appspot.com/6445056/



reply via email to

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