'Process indentation spaces in a block scalar.'

def parse_block_scalar_indent(token_class):

    def callback(lexer, match, context):
        text = match.group()
        if (context.block_scalar_indent is None):
            if (len(text) <= max(context.indent, 0)):
                context.stack.pop()
                context.stack.pop()
                return
            context.block_scalar_indent = len(text)
        elif (len(text) < context.block_scalar_indent):
            context.stack.pop()
            context.stack.pop()
            return
        if text:
            (yield (match.start(), token_class, text))
            context.pos = match.end()
    return callback
