]> git.donarmstrong.com Git - lilypond.git/blob - scm/ly-syntax-constructors.scm
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / scm / ly-syntax-constructors.scm
1 ;;;; define-syntax.scm -- Defines functions for syntax expressions
2 ;;;;
3 ;;;;  source file of the GNU LilyPond music typesetter
4 ;;;; 
5 ;;;; (c) 2006 Erik Sandberg <mandolaerik@gmail.com>
6
7 ;; TODO: use separate module for parser.
8 (define define-ly-syntax define-public)
9
10 ;; This shorthand adds a location parameter, and uses it to set the
11 ;; origin. It can be used for most music functions.
12 (defmacro define-ly-syntax-loc (args . body)
13   (primitive-eval `(define-ly-syntax ,(cons* (car args) 'location (cdr args))
14                      (let ((m ((lambda ,(cdr args) . ,body) . ,(cdr args))))
15                        (set! (ly:music-property m 'origin) location)
16                        m))))
17
18 (define-ly-syntax-loc (sequential-music mlist)
19   (make-sequential-music mlist))
20
21 (define-ly-syntax-loc (simultaneous-music mlist)
22   (make-simultaneous-music mlist))
23
24 (define-ly-syntax-loc (repeat type num body alts)
25   (make-repeat type num body alts))