From a6d15c66a20432a2e7bf0d277a25105465f495db Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sun, 23 Sep 2007 14:03:03 +0200 Subject: [PATCH] MusicXML: Fix indentation of the Output_printer a < increases indentation by one. However, \< or -< should not and << should only increase by one, too. The same goes for \>, -> and >>. Signed-off-by: Reinhold Kainhofer --- python/musicexp.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python/musicexp.py b/python/musicexp.py index 504cdf139a..8649528aba 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -75,8 +75,14 @@ class Output_printer: self._line += str def unformatted_output (self, str): - self._nesting += str.count ('<') + str.count ('{') - self._nesting -= str.count ('>') + str.count ('}') + # don't indent on \< and indent only once on << + self._nesting += ( str.count ('<') + - str.count ('\<') - str.count ('<<') + + str.count ('{') ) + self._nesting -= ( str.count ('>') - str.count ('\>') - str.count ('>>') + - str.count ('->') - str.count ('_>') + - str.count ('^>') + + str.count ('}') ) self.print_verbatim (str) def print_duration_string (self, str): -- 2.39.5