Skip to content

Commit f8a274d

Browse files
authored
sqlparser: export all Expr interfaces (#14371)
Signed-off-by: Vicent Marti <vmg@strn.cat>
1 parent 6311b54 commit f8a274d

File tree

5 files changed

+999
-999
lines changed

5 files changed

+999
-999
lines changed

go/tools/astfmtgen/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ func (r *Rewriter) Rewrite() error {
120120
func (r *Rewriter) replaceAstfmtCalls(cursor *astutil.Cursor) bool {
121121
switch v := cursor.Node().(type) {
122122
case *ast.Comment:
123-
v.Text = strings.ReplaceAll(v.Text, " Format ", " formatFast ")
123+
v.Text = strings.ReplaceAll(v.Text, " Format ", " FormatFast ")
124124
case *ast.FuncDecl:
125125
if v.Name.Name == "Format" {
126-
v.Name.Name = "formatFast"
126+
v.Name.Name = "FormatFast"
127127
}
128128
case *ast.ExprStmt:
129129
if call, ok := v.X.(*ast.CallExpr); ok {
@@ -237,7 +237,7 @@ func (r *Rewriter) rewriteAstPrintf(cursor *astutil.Cursor, expr *ast.CallExpr)
237237
call = &ast.CallExpr{
238238
Fun: &ast.SelectorExpr{
239239
X: rightExpr,
240-
Sel: &ast.Ident{Name: "formatFast"},
240+
Sel: &ast.Ident{Name: "FormatFast"},
241241
},
242242
Args: []ast.Expr{callexpr.X},
243243
}

go/vt/sqlparser/ast.go

Lines changed: 117 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ related to these structs live in ast_funcs.go
3131
// generated by the parser.
3232
type SQLNode interface {
3333
Format(buf *TrackedBuffer)
34-
formatFast(buf *TrackedBuffer)
34+
FormatFast(buf *TrackedBuffer)
3535
}
3636

3737
// Statements
@@ -2232,7 +2232,7 @@ type (
22322232
type (
22332233
// Expr represents an expression.
22342234
Expr interface {
2235-
iExpr()
2235+
IsExpr()
22362236
SQLNode
22372237
}
22382238

@@ -3140,121 +3140,121 @@ type (
31403140
)
31413141

31423142
// iExpr ensures that only expressions nodes can be assigned to a Expr
3143-
func (*AndExpr) iExpr() {}
3144-
func (*OrExpr) iExpr() {}
3145-
func (*XorExpr) iExpr() {}
3146-
func (*NotExpr) iExpr() {}
3147-
func (*ComparisonExpr) iExpr() {}
3148-
func (*BetweenExpr) iExpr() {}
3149-
func (*IsExpr) iExpr() {}
3150-
func (*ExistsExpr) iExpr() {}
3151-
func (*AssignmentExpr) iExpr() {}
3152-
func (*Literal) iExpr() {}
3153-
func (*Argument) iExpr() {}
3154-
func (*NullVal) iExpr() {}
3155-
func (BoolVal) iExpr() {}
3156-
func (*ColName) iExpr() {}
3157-
func (ValTuple) iExpr() {}
3158-
func (*Subquery) iExpr() {}
3159-
func (ListArg) iExpr() {}
3160-
func (*BinaryExpr) iExpr() {}
3161-
func (*UnaryExpr) iExpr() {}
3162-
func (*IntroducerExpr) iExpr() {}
3163-
func (*CollateExpr) iExpr() {}
3164-
func (*FuncExpr) iExpr() {}
3165-
func (*TimestampDiffExpr) iExpr() {}
3166-
func (*ExtractFuncExpr) iExpr() {}
3167-
func (*WeightStringFuncExpr) iExpr() {}
3168-
func (*CurTimeFuncExpr) iExpr() {}
3169-
func (*CaseExpr) iExpr() {}
3170-
func (*ValuesFuncExpr) iExpr() {}
3171-
func (*CastExpr) iExpr() {}
3172-
func (*ConvertExpr) iExpr() {}
3173-
func (*SubstrExpr) iExpr() {}
3174-
func (*InsertExpr) iExpr() {}
3175-
func (*IntervalFuncExpr) iExpr() {}
3176-
func (*LocateExpr) iExpr() {}
3177-
func (*CharExpr) iExpr() {}
3178-
func (*ConvertUsingExpr) iExpr() {}
3179-
func (*MatchExpr) iExpr() {}
3180-
func (*Default) iExpr() {}
3181-
func (*TrimFuncExpr) iExpr() {}
3182-
func (*JSONSchemaValidFuncExpr) iExpr() {}
3183-
func (*JSONSchemaValidationReportFuncExpr) iExpr() {}
3184-
func (*Offset) iExpr() {}
3185-
func (*JSONPrettyExpr) iExpr() {}
3186-
func (*JSONStorageFreeExpr) iExpr() {}
3187-
func (*JSONStorageSizeExpr) iExpr() {}
3188-
func (*JSONContainsExpr) iExpr() {}
3189-
func (*JSONContainsPathExpr) iExpr() {}
3190-
func (*JSONExtractExpr) iExpr() {}
3191-
func (*JSONKeysExpr) iExpr() {}
3192-
func (*JSONOverlapsExpr) iExpr() {}
3193-
func (*JSONSearchExpr) iExpr() {}
3194-
func (*JSONValueExpr) iExpr() {}
3195-
func (*JSONArrayExpr) iExpr() {}
3196-
func (*JSONObjectExpr) iExpr() {}
3197-
func (*JSONQuoteExpr) iExpr() {}
3198-
func (*JSONAttributesExpr) iExpr() {}
3199-
func (*JSONValueModifierExpr) iExpr() {}
3200-
func (*JSONValueMergeExpr) iExpr() {}
3201-
func (*JSONRemoveExpr) iExpr() {}
3202-
func (*JSONUnquoteExpr) iExpr() {}
3203-
func (*MemberOfExpr) iExpr() {}
3204-
func (*RegexpInstrExpr) iExpr() {}
3205-
func (*RegexpLikeExpr) iExpr() {}
3206-
func (*RegexpReplaceExpr) iExpr() {}
3207-
func (*RegexpSubstrExpr) iExpr() {}
3208-
func (*IntervalDateExpr) iExpr() {}
3209-
func (*ArgumentLessWindowExpr) iExpr() {}
3210-
func (*FirstOrLastValueExpr) iExpr() {}
3211-
func (*NtileExpr) iExpr() {}
3212-
func (*NTHValueExpr) iExpr() {}
3213-
func (*LagLeadExpr) iExpr() {}
3214-
func (*NamedWindow) iExpr() {}
3215-
func (*ExtractValueExpr) iExpr() {}
3216-
func (*UpdateXMLExpr) iExpr() {}
3217-
func (*LockingFunc) iExpr() {}
3218-
func (*PerformanceSchemaFuncExpr) iExpr() {}
3219-
func (*GTIDFuncExpr) iExpr() {}
3220-
func (*Sum) iExpr() {}
3221-
func (*Min) iExpr() {}
3222-
func (*Max) iExpr() {}
3223-
func (*Avg) iExpr() {}
3224-
func (*CountStar) iExpr() {}
3225-
func (*Count) iExpr() {}
3226-
func (*GroupConcatExpr) iExpr() {}
3227-
func (*AnyValue) iExpr() {}
3228-
func (*BitAnd) iExpr() {}
3229-
func (*BitOr) iExpr() {}
3230-
func (*BitXor) iExpr() {}
3231-
func (*Std) iExpr() {}
3232-
func (*StdDev) iExpr() {}
3233-
func (*StdPop) iExpr() {}
3234-
func (*StdSamp) iExpr() {}
3235-
func (*VarPop) iExpr() {}
3236-
func (*VarSamp) iExpr() {}
3237-
func (*Variance) iExpr() {}
3238-
func (*Variable) iExpr() {}
3239-
func (*PointExpr) iExpr() {}
3240-
func (*LineStringExpr) iExpr() {}
3241-
func (*PolygonExpr) iExpr() {}
3242-
func (*MultiPolygonExpr) iExpr() {}
3243-
func (*MultiPointExpr) iExpr() {}
3244-
func (*MultiLinestringExpr) iExpr() {}
3245-
func (*GeomFromTextExpr) iExpr() {}
3246-
func (*GeomFromWKBExpr) iExpr() {}
3247-
func (*GeomFormatExpr) iExpr() {}
3248-
func (*GeomPropertyFuncExpr) iExpr() {}
3249-
func (*PointPropertyFuncExpr) iExpr() {}
3250-
func (*LinestrPropertyFuncExpr) iExpr() {}
3251-
func (*PolygonPropertyFuncExpr) iExpr() {}
3252-
func (*GeomCollPropertyFuncExpr) iExpr() {}
3253-
func (*GeoHashFromLatLongExpr) iExpr() {}
3254-
func (*GeoHashFromPointExpr) iExpr() {}
3255-
func (*GeomFromGeoHashExpr) iExpr() {}
3256-
func (*GeoJSONFromGeomExpr) iExpr() {}
3257-
func (*GeomFromGeoJSONExpr) iExpr() {}
3143+
func (*AndExpr) IsExpr() {}
3144+
func (*OrExpr) IsExpr() {}
3145+
func (*XorExpr) IsExpr() {}
3146+
func (*NotExpr) IsExpr() {}
3147+
func (*ComparisonExpr) IsExpr() {}
3148+
func (*BetweenExpr) IsExpr() {}
3149+
func (*IsExpr) IsExpr() {}
3150+
func (*ExistsExpr) IsExpr() {}
3151+
func (*AssignmentExpr) IsExpr() {}
3152+
func (*Literal) IsExpr() {}
3153+
func (*Argument) IsExpr() {}
3154+
func (*NullVal) IsExpr() {}
3155+
func (BoolVal) IsExpr() {}
3156+
func (*ColName) IsExpr() {}
3157+
func (ValTuple) IsExpr() {}
3158+
func (*Subquery) IsExpr() {}
3159+
func (ListArg) IsExpr() {}
3160+
func (*BinaryExpr) IsExpr() {}
3161+
func (*UnaryExpr) IsExpr() {}
3162+
func (*IntroducerExpr) IsExpr() {}
3163+
func (*CollateExpr) IsExpr() {}
3164+
func (*FuncExpr) IsExpr() {}
3165+
func (*TimestampDiffExpr) IsExpr() {}
3166+
func (*ExtractFuncExpr) IsExpr() {}
3167+
func (*WeightStringFuncExpr) IsExpr() {}
3168+
func (*CurTimeFuncExpr) IsExpr() {}
3169+
func (*CaseExpr) IsExpr() {}
3170+
func (*ValuesFuncExpr) IsExpr() {}
3171+
func (*CastExpr) IsExpr() {}
3172+
func (*ConvertExpr) IsExpr() {}
3173+
func (*SubstrExpr) IsExpr() {}
3174+
func (*InsertExpr) IsExpr() {}
3175+
func (*IntervalFuncExpr) IsExpr() {}
3176+
func (*LocateExpr) IsExpr() {}
3177+
func (*CharExpr) IsExpr() {}
3178+
func (*ConvertUsingExpr) IsExpr() {}
3179+
func (*MatchExpr) IsExpr() {}
3180+
func (*Default) IsExpr() {}
3181+
func (*TrimFuncExpr) IsExpr() {}
3182+
func (*JSONSchemaValidFuncExpr) IsExpr() {}
3183+
func (*JSONSchemaValidationReportFuncExpr) IsExpr() {}
3184+
func (*Offset) IsExpr() {}
3185+
func (*JSONPrettyExpr) IsExpr() {}
3186+
func (*JSONStorageFreeExpr) IsExpr() {}
3187+
func (*JSONStorageSizeExpr) IsExpr() {}
3188+
func (*JSONContainsExpr) IsExpr() {}
3189+
func (*JSONContainsPathExpr) IsExpr() {}
3190+
func (*JSONExtractExpr) IsExpr() {}
3191+
func (*JSONKeysExpr) IsExpr() {}
3192+
func (*JSONOverlapsExpr) IsExpr() {}
3193+
func (*JSONSearchExpr) IsExpr() {}
3194+
func (*JSONValueExpr) IsExpr() {}
3195+
func (*JSONArrayExpr) IsExpr() {}
3196+
func (*JSONObjectExpr) IsExpr() {}
3197+
func (*JSONQuoteExpr) IsExpr() {}
3198+
func (*JSONAttributesExpr) IsExpr() {}
3199+
func (*JSONValueModifierExpr) IsExpr() {}
3200+
func (*JSONValueMergeExpr) IsExpr() {}
3201+
func (*JSONRemoveExpr) IsExpr() {}
3202+
func (*JSONUnquoteExpr) IsExpr() {}
3203+
func (*MemberOfExpr) IsExpr() {}
3204+
func (*RegexpInstrExpr) IsExpr() {}
3205+
func (*RegexpLikeExpr) IsExpr() {}
3206+
func (*RegexpReplaceExpr) IsExpr() {}
3207+
func (*RegexpSubstrExpr) IsExpr() {}
3208+
func (*IntervalDateExpr) IsExpr() {}
3209+
func (*ArgumentLessWindowExpr) IsExpr() {}
3210+
func (*FirstOrLastValueExpr) IsExpr() {}
3211+
func (*NtileExpr) IsExpr() {}
3212+
func (*NTHValueExpr) IsExpr() {}
3213+
func (*LagLeadExpr) IsExpr() {}
3214+
func (*NamedWindow) IsExpr() {}
3215+
func (*ExtractValueExpr) IsExpr() {}
3216+
func (*UpdateXMLExpr) IsExpr() {}
3217+
func (*LockingFunc) IsExpr() {}
3218+
func (*PerformanceSchemaFuncExpr) IsExpr() {}
3219+
func (*GTIDFuncExpr) IsExpr() {}
3220+
func (*Sum) IsExpr() {}
3221+
func (*Min) IsExpr() {}
3222+
func (*Max) IsExpr() {}
3223+
func (*Avg) IsExpr() {}
3224+
func (*CountStar) IsExpr() {}
3225+
func (*Count) IsExpr() {}
3226+
func (*GroupConcatExpr) IsExpr() {}
3227+
func (*AnyValue) IsExpr() {}
3228+
func (*BitAnd) IsExpr() {}
3229+
func (*BitOr) IsExpr() {}
3230+
func (*BitXor) IsExpr() {}
3231+
func (*Std) IsExpr() {}
3232+
func (*StdDev) IsExpr() {}
3233+
func (*StdPop) IsExpr() {}
3234+
func (*StdSamp) IsExpr() {}
3235+
func (*VarPop) IsExpr() {}
3236+
func (*VarSamp) IsExpr() {}
3237+
func (*Variance) IsExpr() {}
3238+
func (*Variable) IsExpr() {}
3239+
func (*PointExpr) IsExpr() {}
3240+
func (*LineStringExpr) IsExpr() {}
3241+
func (*PolygonExpr) IsExpr() {}
3242+
func (*MultiPolygonExpr) IsExpr() {}
3243+
func (*MultiPointExpr) IsExpr() {}
3244+
func (*MultiLinestringExpr) IsExpr() {}
3245+
func (*GeomFromTextExpr) IsExpr() {}
3246+
func (*GeomFromWKBExpr) IsExpr() {}
3247+
func (*GeomFormatExpr) IsExpr() {}
3248+
func (*GeomPropertyFuncExpr) IsExpr() {}
3249+
func (*PointPropertyFuncExpr) IsExpr() {}
3250+
func (*LinestrPropertyFuncExpr) IsExpr() {}
3251+
func (*PolygonPropertyFuncExpr) IsExpr() {}
3252+
func (*GeomCollPropertyFuncExpr) IsExpr() {}
3253+
func (*GeoHashFromLatLongExpr) IsExpr() {}
3254+
func (*GeoHashFromPointExpr) IsExpr() {}
3255+
func (*GeomFromGeoHashExpr) IsExpr() {}
3256+
func (*GeoJSONFromGeomExpr) IsExpr() {}
3257+
func (*GeomFromGeoJSONExpr) IsExpr() {}
32583258

32593259
// iCallable marks all expressions that represent function calls
32603260
func (*FuncExpr) iCallable() {}

0 commit comments

Comments
 (0)