From: Han-Wen Nienhuys Date: Sun, 27 Oct 2002 01:22:07 +0000 (+0000) Subject: * ly/declarations-init.ly: use Scheme for dimension defs. X-Git-Tag: release/1.7.5~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f67039a8cc4182dba8d6a04a62acba939409e784;p=lilypond.git * ly/declarations-init.ly: use Scheme for dimension defs. * lily/parser.yy (TODO): remove hard coded dimensions, add REAL NUMBER_IDENTIFIER production. --- diff --git a/ChangeLog b/ChangeLog index 06e65eb903..97d613f3df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2002-10-27 Han-Wen Nienhuys + * ly/declarations-init.ly: use Scheme for dimension defs. + + * lily/parser.yy (TODO): remove hard coded dimensions, add + REAL NUMBER_IDENTIFIER production. + * lily/rest-collision.cc (force_shift_callback): rewrite using -done property. @@ -42,6 +47,8 @@ 2002-10-21 Han-Wen Nienhuys + * VERSION: 1.7.4 released. + * scm/generate-documentation.scm (string-append): add macro definitions. diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index c4d69313c7..cc3e5df351 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -35,11 +35,9 @@ static Keyword_ent the_key_tab[]={ {"alternative", ALTERNATIVE}, {"bar", BAR}, {"breathe", BREATHE}, - {"char", CHAR_T}, {"chordmodifiers", CHORDMODIFIERS}, {"chords", CHORDS}, {"clef", CLEF}, - {"cm", CM_T}, {"consists", CONSISTS}, {"consistsend", CONSISTSEND}, {"context", CONTEXT}, @@ -50,7 +48,6 @@ static Keyword_ent the_key_tab[]={ {"figures",FIGURES}, {"grace", GRACE}, {"header", HEADER}, - {"in", IN_T}, {"lyrics", LYRICS}, {"key", KEY}, {"mark", MARK}, @@ -59,7 +56,6 @@ static Keyword_ent the_key_tab[]={ {"time", TIME_T}, {"times", TIMES}, {"midi", MIDI}, - {"mm", MM_T}, {"name", NAME}, {"pitchnames", PITCHNAMES}, {"notes", NOTES}, @@ -71,7 +67,6 @@ static Keyword_ent the_key_tab[]={ {"partial", PARTIAL}, {"paper", PAPER}, {"property", PROPERTY}, - {"pt", PT_T}, {"relative", RELATIVE}, {"remove", REMOVE}, {"repeat", REPEAT}, diff --git a/lily/parser.yy b/lily/parser.yy index 95a07efbac..0c92e7a977 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -186,9 +186,7 @@ yylex (YYSTYPE *s, void * v) %token BREATHE %token CHORDMODIFIERS %token CHORDS -%token CHAR_T %token CLEF -%token CM_T %token CONSISTS %token DURATION %token SEQUENTIAL @@ -202,14 +200,12 @@ yylex (YYSTYPE *s, void * v) %token GRACE %token HEADER %token HYPHEN -%token IN_T %token INVALID %token KEY %token LYRICS %token MARK %token MULTI_MEASURE_REST %token MIDI -%token MM_T %token PITCH %token DEFAULT %token NAME @@ -220,7 +216,6 @@ yylex (YYSTYPE *s, void * v) %token PARTIAL %token PROPERTY %token OVERRIDE SET REVERT -%token PT_T %token RELATIVE %token REMOVE %token REPEAT @@ -2090,20 +2085,8 @@ bare_number: | NUMBER_IDENTIFIER { $$ = $1; } - | REAL CM_T { - $$ = gh_double2scm (gh_scm2double ($1) CM ); - } - | REAL PT_T { - $$ = gh_double2scm (gh_scm2double ($1) PT); - } - | REAL IN_T { - $$ = gh_double2scm (gh_scm2double ($1) INCH); - } - | REAL MM_T { - $$ = gh_double2scm (gh_scm2double ($1) MM); - } - | REAL CHAR_T { - $$ = gh_double2scm (gh_scm2double ($1) CHAR); + | REAL NUMBER_IDENTIFIER { + $$ = gh_double2scm (gh_scm2double ($1) * gh_scm2double ($2)); } ; diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index 1ae8561c1e..cec3097a7f 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -34,6 +34,16 @@ melismaEnd = \property Staff.melismaBusy = ##f % ugh \include "midi-init.ly" + +% Do units first; must be done before any units are specified. +\paper { + unit = "mm" + mm = 1.0 + in = 25.4 + pt = #(/ in 72.27) + cm = #(* 10 mm) +} + papersize = "a4" paperfile = \papersize + "-init.ly" diff --git a/ly/params-init.ly b/ly/params-init.ly index 8e144cc9a7..c92c7c81c2 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -18,7 +18,6 @@ paperfile = \papersize + "-init.ly" \include \paperfile \include "paper-init.ly" -unit = "mm" staffspace = #(/ staffheight 4.0) linethickness = #(/ staffspace 10.0) outputscale = #(/ staffheight 4.0)