diff options
author | Valentin Villenave <valentin@villenave.net> | 2010-12-22 12:54:38 +0100 |
---|---|---|
committer | Valentin Villenave <valentin@villenave.net> | 2010-12-22 12:54:38 +0100 |
commit | cc33039b84da82a8fe41503b4434db30ac9bf4ab (patch) | |
tree | 420b53665683c1082ad4f294ae7c1c33fa289074 | |
parent | 2496667113e786b03749c64ff38caee4bb9ed74b (diff) |
Add direction-awareness ability to post-event music functions
-rw-r--r-- | input/regression/music-function-post-event.ly | 22 | ||||
-rw-r--r-- | lily/parser.yy | 6 |
2 files changed, 27 insertions, 1 deletions
diff --git a/input/regression/music-function-post-event.ly b/input/regression/music-function-post-event.ly new file mode 100644 index 0000000000..673142e3cf --- /dev/null +++ b/input/regression/music-function-post-event.ly @@ -0,0 +1,22 @@ +\version "2.13.44" + +\header +{ + + texidoc = "Music functions may be attached to notes; +in this case they must be introduced by a direction +indicator. If a non-neutral direction is given (i.e. +anything else than a dash), then the 'direction property +of the resulting object is set accordingly." + +} + +dynScript = +#(define-music-function (parser location text) (string?) + (make-dynamic-script text)) + +\relative c' { + c1-\dynScript "pp" + c^\dynScript "fp" + c_\dynScript "spz" +} diff --git a/lily/parser.yy b/lily/parser.yy index 94dacc5d3e..92c21c7194 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1706,8 +1706,12 @@ post_event: direction_less_event { $$ = $1; } - | '-' music_function_event { + | script_dir music_function_event { $$ = run_music_function (PARSER, $2); + if ($1) + { + unsmob_music ($$)->set_property ("direction", scm_from_int ($1)); + } } | HYPHEN { if (!PARSER->lexer_->is_lyric_state ()) |