@@ -727,6 +727,9 @@ type (
727727 // ListArg represents a named list argument.
728728 ListArg []byte
729729
730+ // ListArgConcatamer represents a concatamer string of apparent list arguments / postgres cast operators.
731+ ListArgConcatamer []ListArg
732+
730733 // ValTuple represents a tuple of actual values.
731734 ValTuple Exprs
732735
@@ -742,6 +745,12 @@ type (
742745 Expr Expr
743746 }
744747
748+ // UnaryCastConcatamerExpr represents an expression with a casting concatamer suffix.
749+ UnaryCastConcatamerExpr struct {
750+ CastConcatamer ListArgConcatamer
751+ Expr Expr
752+ }
753+
745754 // IntervalExpr represents a date-time INTERVAL expression.
746755 IntervalExpr struct {
747756 Expr Expr
@@ -843,36 +852,37 @@ type (
843852)
844853
845854// iExpr ensures that only expressions nodes can be assigned to a Expr
846- func (* AndExpr ) iExpr () {}
847- func (* OrExpr ) iExpr () {}
848- func (* XorExpr ) iExpr () {}
849- func (* NotExpr ) iExpr () {}
850- func (* ComparisonExpr ) iExpr () {}
851- func (* RangeCond ) iExpr () {}
852- func (* IsExpr ) iExpr () {}
853- func (* ExistsExpr ) iExpr () {}
854- func (* SQLVal ) iExpr () {}
855- func (* NullVal ) iExpr () {}
856- func (BoolVal ) iExpr () {}
857- func (* ColName ) iExpr () {}
858- func (ValTuple ) iExpr () {}
859- func (* Subquery ) iExpr () {}
860- func (ListArg ) iExpr () {}
861- func (* BinaryExpr ) iExpr () {}
862- func (* UnaryExpr ) iExpr () {}
863- func (* IntervalExpr ) iExpr () {}
864- func (* CollateExpr ) iExpr () {}
865- func (* FuncExpr ) iExpr () {}
866- func (* TimestampFuncExpr ) iExpr () {}
867- func (* CurTimeFuncExpr ) iExpr () {}
868- func (* CaseExpr ) iExpr () {}
869- func (* ValuesFuncExpr ) iExpr () {}
870- func (* ConvertExpr ) iExpr () {}
871- func (* SubstrExpr ) iExpr () {}
872- func (* ConvertUsingExpr ) iExpr () {}
873- func (* MatchExpr ) iExpr () {}
874- func (* GroupConcatExpr ) iExpr () {}
875- func (* Default ) iExpr () {}
855+ func (* AndExpr ) iExpr () {}
856+ func (* OrExpr ) iExpr () {}
857+ func (* XorExpr ) iExpr () {}
858+ func (* NotExpr ) iExpr () {}
859+ func (* ComparisonExpr ) iExpr () {}
860+ func (* RangeCond ) iExpr () {}
861+ func (* IsExpr ) iExpr () {}
862+ func (* ExistsExpr ) iExpr () {}
863+ func (* SQLVal ) iExpr () {}
864+ func (* NullVal ) iExpr () {}
865+ func (BoolVal ) iExpr () {}
866+ func (* ColName ) iExpr () {}
867+ func (ValTuple ) iExpr () {}
868+ func (* Subquery ) iExpr () {}
869+ func (ListArg ) iExpr () {}
870+ func (* BinaryExpr ) iExpr () {}
871+ func (* UnaryExpr ) iExpr () {}
872+ func (* UnaryCastConcatamerExpr ) iExpr () {}
873+ func (* IntervalExpr ) iExpr () {}
874+ func (* CollateExpr ) iExpr () {}
875+ func (* FuncExpr ) iExpr () {}
876+ func (* TimestampFuncExpr ) iExpr () {}
877+ func (* CurTimeFuncExpr ) iExpr () {}
878+ func (* CaseExpr ) iExpr () {}
879+ func (* ValuesFuncExpr ) iExpr () {}
880+ func (* ConvertExpr ) iExpr () {}
881+ func (* SubstrExpr ) iExpr () {}
882+ func (* ConvertUsingExpr ) iExpr () {}
883+ func (* MatchExpr ) iExpr () {}
884+ func (* GroupConcatExpr ) iExpr () {}
885+ func (* Default ) iExpr () {}
876886
877887// Exprs represents a list of value expressions.
878888// It's not a valid expression because it's not parenthesized.
@@ -1766,6 +1776,15 @@ func (node *BinaryExpr) Format(buf *TrackedBuffer) {
17661776 buf .astPrintf (node , "%v %s %v" , node .Left , node .Operator , node .Right )
17671777}
17681778
1779+ // Format formats the node.
1780+ func (node * UnaryCastConcatamerExpr ) Format (buf * TrackedBuffer ) {
1781+ var s string
1782+ for _ , n := range node .CastConcatamer {
1783+ s = s + string (n )
1784+ }
1785+ buf .astPrintf (node , "%v%s" , node .Expr , s )
1786+ }
1787+
17691788// Format formats the node.
17701789func (node * UnaryExpr ) Format (buf * TrackedBuffer ) {
17711790 if _ , unary := node .Expr .(* UnaryExpr ); unary {
0 commit comments