David Kastrup <dak <at> gnu.org> writes: > >>>> One really ugly problem is interpreting things like "4.". Looks like a > >>>> duration, but then we have > >>>> input/regression/dynamics-broken-hairpin.ly: line-width = 4.\cm
The parser chooses among (too) many different modes ("start conditions") telling the lexer what kind of input to expect in the current context. Floating-point numbers and note-durations appear in rather different situations. If both are valid in the same lexer modes, then maybe you can adjust the modes toward a smarter design. > Well, let's see what the parser currently delivers in INITIAL mode. > > . character . > -. REAL 0.0 > -.0 REAL -0.0 > -0.0 character - followed by 0.0 > > The semantics of -., for example, were introduced in 2.15.9 with > commit da949cdcede0ffb559e9e5e2adbae2088ba1f6d6 I needed to interpret "\layout {indent = -.\mm}" without backing up in order to obey the instructions for changing lexer.ll while fixing issue 804. I tested both interpretations, "staccato" or "0.0" (should have been -0.0) http://codereview.appspot.com/4871041/diff2/3001:8001/lily/lexer.ll At the time, I did not foresee staccatos being valid in a \layout block. If you expect to restrict REAL to -?[0-9]+(\.[0.9]+)? then I suggest you switch back to interpreting \layout {indent = -.\mm } as a staccato before the next stable release, or raise a bug and I'll do so. _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel