expression :: Parser AST.Expression
expression = Expr.buildExpressionParser opTable term
  where opTable = [ [prefix AST.Sub]
                  , [infixLeft AST.Mul, infixLeft AST.Div]
                  , [infixLeft AST.Add, infixLeft AST.Sub] ]
        infixLeft op = Expr.Infix (AST.InfixOperation <$> operator op) Expr.AssocLeft
        prefix op = Expr.Prefix (AST.PrefixOperation <$> operator op)
        term = colorLiteral
           <|> floatLiteral
           <|> stringLiteral
           <|> functionCall
           <|> Token.parens expression
           <?> "expression"
expression :: Parser AST.Expression
expression = Expr.buildExpressionParser opTable term
  where opTable = [ [prefix AST.Sub]
                  , [infixLeft AST.Mul, infixLeft AST.Div]
                  , [infixLeft AST.Add, infixLeft AST.Sub] ]
        infixLeft op = Expr.Infix (AST.InfixOperation <$> operator op) Expr.AssocLeft
        prefix op = Expr.Prefix (AST.PrefixOperation <$> operator op)
        term = colorLiteral
           <|> floatLiteral
           <|> stringLiteral
           <|> functionCall
           <|> Token.parens expression
           <?> "expression"
expression = Expr.buildExpressionParser opTable term
  where opTable = [ [prefix AST.Sub]
                  , [infixLeft AST.Mul, infixLeft AST.Div]
                  , [infixLeft AST.Add, infixLeft AST.Sub] ]
        infixLeft op = Expr.Infix (AST.InfixOperation <$> operator op) Expr.AssocLeft
        prefix op = Expr.Prefix (AST.PrefixOperation <$> operator op)
        term = colorLiteral
           <|> floatLiteral
           <|> stringLiteral
           <|> functionCall
           <|> Token.parens expression
           <?> "expression"