'Do not produce empty tokens.'

def something(token_class):

    def callback(lexer, match, context):
        text = match.group()
        if (not text):
            return
        (yield (match.start(), token_class, text))
        context.pos = match.end()
    return callback
