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 <reinhold@kainhofer.com>
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):