From f4329704f5424e938f7c8f91132ed90975b95b8f Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Tue, 29 Jul 2008 21:02:47 +0100 Subject: [PATCH] Fix \put-adjacent. Add new signature to parser and change argument order. --- Documentation/user/programming-interface.itely | 1 + lily/lexer.ll | 2 ++ lily/parser.yy | 4 ++++ scm/define-markup-commands.scm | 12 +++--------- scm/translation-functions.scm | 10 +++++----- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Documentation/user/programming-interface.itely b/Documentation/user/programming-interface.itely index 4b0c523a71..9263b951dc 100644 --- a/Documentation/user/programming-interface.itely +++ b/Documentation/user/programming-interface.itely @@ -1132,6 +1132,7 @@ Currently, the available combinations of arguments (after the standard @itemx @var{scm markup} @itemx @var{scm scm} @itemx @var{scm scm markup} +@itemx @var{scm scm markup markup} @itemx @var{scm markup markup} @itemx @var{scm scm scm} @end table diff --git a/lily/lexer.ll b/lily/lexer.ll index bec065347b..ef419634bb 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -539,6 +539,8 @@ BOM_UTF8 \357\273\277 return MARKUP_HEAD_SCM0_MARKUP1; else if (tag == ly_symbol2scm ("scheme0-scheme1-markup2")) return MARKUP_HEAD_SCM0_SCM1_MARKUP2; + else if (tag == ly_symbol2scm ("scheme0-scheme1-markup2-markup3")) + return MARKUP_HEAD_SCM0_SCM1_MARKUP2_MARKUP3; else if (tag == ly_symbol2scm ("scheme0-markup1-markup2")) return MARKUP_HEAD_SCM0_MARKUP1_MARKUP2; else if (tag == ly_symbol2scm ("scheme0-scheme1-scheme2")) diff --git a/lily/parser.yy b/lily/parser.yy index 59cbf58502..be4e7e26e5 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -280,6 +280,7 @@ If we give names, Bison complains. %token MARKUP_HEAD_SCM0_MARKUP1 %token MARKUP_HEAD_SCM0_SCM1 %token MARKUP_HEAD_SCM0_SCM1_MARKUP2 +%token MARKUP_HEAD_SCM0_SCM1_MARKUP2_MARKUP3 %token MARKUP_HEAD_SCM0_MARKUP1_MARKUP2 %token MARKUP_HEAD_SCM0_SCM1_SCM2 %token MARKUP_LIST_HEAD_EMPTY @@ -2362,6 +2363,9 @@ simple_markup: | MARKUP_HEAD_SCM0_MARKUP1_MARKUP2 embedded_scm markup markup { $$ = scm_list_4 ($1, $2, $3, $4); } + | MARKUP_HEAD_SCM0_SCM1_MARKUP2_MARKUP3 embedded_scm embedded_scm markup markup { + $$ = scm_list_5 ($1, $2, $3, $4, $5); + } | MARKUP_HEAD_EMPTY { $$ = scm_list_1 ($1); } diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index c5423eb9c2..1af92b3b7f 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -1443,17 +1443,11 @@ Add padding @var{amount} around @var{arg} in the X@tie{}direction. (interval-widen x amount) y))) -(define-builtin-markup-command (put-adjacent layout props arg1 axis dir arg2) - (markup? integer? ly:dir? markup?) +(define-builtin-markup-command (put-adjacent layout props axis dir arg1 arg2) + (integer? ly:dir? markup? markup?) align () - " -@ignore -This is broken, since there's no parser tag for the signature -markup_scm_scm_markup. Only works using Scheme markup. -np -@end ignore - -Put @var{arg2} next to @var{arg1}, without moving @var{arg1}." + "Put @var{arg2} next to @var{arg1}, without moving @var{arg1}." (let ((m1 (interpret-markup layout props arg1)) (m2 (interpret-markup layout props arg2))) (ly:stencil-combine-at-edge m1 axis dir m2 0.0))) diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 0367a007ae..667b0e2679 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -139,10 +139,10 @@ (if alt-markup (set! fig-markup (markup #:put-adjacent - fig-markup X - (if (number? alt-dir) - alt-dir - LEFT) + X (if (number? alt-dir) + alt-dir + LEFT) + fig-markup #:pad-x 0.2 alt-markup ))) @@ -151,10 +151,10 @@ (set! fig-markup (if fig-markup (markup #:put-adjacent - fig-markup X (if (number? plus-dir) plus-dir LEFT) + fig-markup #:pad-x 0.2 plus-markup) plus-markup))) -- 2.39.5