]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/markup-cyclic-reference.ly
Run scripts/auxiliar/update-with-convert-ly.sh
[lilypond.git] / input / regression / markup-cyclic-reference.ly
1 \version "2.16.0"
2 #(ly:set-option 'warning-as-error #f)
3 #(ly:expect-warning (ly:translate-cpp-warning-scheme "Cyclic markup detected: %s") 'cycle-markup)
4 #(ly:expect-warning (ly:translate-cpp-warning-scheme "Cyclic markup detected: %s") 'cycleI-markup)
5
6 \header {
7   texidoc = "Cyclic markup definitions should cause a warning, but
8 not crash LilyPond with an endless loop"
9 }
10
11 % A simple markup function that calls itself in a loop.
12 #(define-markup-command (cycle layout props m)
13   (markup?)
14   (interpret-markup layout props (make-cycle-markup m)))
15
16 % Two simple markup functions that call each other in a loop.
17 #(define-markup-command (cycleI layout props m)
18   (markup?)
19   (interpret-markup layout props (make-cycleII-markup m)))
20 #(define-markup-command (cycleII layout props m)
21   (markup?)
22   (interpret-markup layout props (make-cycleI-markup m)))
23
24
25 \markup { \cycle "a" }
26 \markup { \cycleI "a" }