This permits writing things like
mkMove = #(define-music-function
(parser location x y)
( number? number? )
#{ \once \override TextScript #'extra-offset = #(cons x y)
#})
{
\mkMove 4.4 -3.3
c1^"XY"
}
Since integers are accepted in this kind of usage, not accepting
floating point numbers appears inconsistent.
While in INITIAL mode like inside of layout blocks real numbers can
be written like 4. or -.3 for historic reasons, permitting this inside
of music could easily lead to confusion with durations or
articulations, so those spellings remain invalid in music modes.
Decimal fractions are also not accepted in \chordmode since this would
preclude chord entry like c:13.11^3.7 and similar.
FRACTION {N}+\/{N}+
INT -?{UNSIGNED}
REAL ({INT}\.{N}*)|(-?\.{N}+)
+STRICTREAL {UNSIGNED}\.{UNSIGNED}
WHITE [ \n\t\f\r]
HORIZONTALWHITE [ \t]
BLACK [^ \n\t\f\r]
yylval = scan_fraction (YYText ());
return FRACTION;
}
- {UNSIGNED}/\/ | // backup rule
- {UNSIGNED} {
+ {STRICTREAL} {
+ yylval = scm_c_read_string (YYText ());
+ return REAL;
+ }
+ {UNSIGNED}/[/.] | // backup rule
+ {UNSIGNED} {
yylval = scm_c_read_string (YYText ());
return UNSIGNED;
}
yylval = scan_fraction (YYText ());
return FRACTION;
}
- {UNSIGNED}/\/ | // backup rule
+ {STRICTREAL} {
+ yylval = scm_c_read_string (YYText ());
+ return REAL;
+ }
+ {UNSIGNED}/[/.] | // backup rule
{UNSIGNED} {
yylval = scm_c_read_string (YYText ());
return UNSIGNED;