IDENT = Word(alphas, alphanums + '_')
attribute = IDENT + Suppress(':') + Word(alphanums) + OPCOMMENT
element = Suppress('-') + IDENT + OPCOMMENT
elementBlock = Forward()
blockContent = attribute | elementBlock | COMMENT
elementBlock << element + Optional(indentedBlock(blockContent, [1]))
Простая демонстрация рекурсивного использования indentedBlock pyparsing