def op_symbol(op_node):
    """Get the GLSL symbol for a Python operator."""
    ops = {
        # TODO(nicholasbishop): other unary ops
        ast.UAdd: '+',
        ast.USub: '-',

        # TODO(nicholasbishop): FloorDiv, Pow, LShift, RShift,
        # BitOr, BitXor, BitAnd
        ast.Add: '+',
        ast.Sub: '-',
        ast.Mult: '*',
        ast.Div: '/',
        ast.Mod: '%',

        # Comparison
        ast.Eq: '=',
        ast.NotEq: '!=',
        ast.Lt: '<',
        ast.LtE: '<=',
        ast.Gt: '>',
        ast.GtE: '>=',
    }
    # Python3 matrix multiplication
    if hasattr(ast, 'MatMult'):
        ops[ast.MatMult] = '*'
    return ops[op_node.__class__]
Get the GLSL symbol for a Python operator.