Skip to content

Commit 68373b1

Browse files
committed
refactor(ast): Removed redundant type ast.Expr (specified only from SQLite parser as base (embedded) type for more Expr* types, no usages as standalone type)
1 parent 2e0435c commit 68373b1

File tree

4 files changed

+2
-23
lines changed

4 files changed

+2
-23
lines changed

internal/engine/sqlite/convert.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,6 @@ func (c *cc) convertFuncContext(n *parser.Expr_functionContext) ast.Node {
311311
return todo("convertFuncContext", n)
312312
}
313313

314-
func (c *cc) convertExprContext(n *parser.ExprContext) ast.Node {
315-
return &ast.Expr{}
316-
}
317-
318314
func (c *cc) convertColumnNameExpr(n *parser.Expr_qualified_column_nameContext) *ast.ColumnRef {
319315
var items []ast.Node
320316
if schema, ok := n.Schema_name().(*parser.Schema_nameContext); ok {
@@ -826,7 +822,7 @@ func (c *cc) convertUnaryExpr(n *parser.Expr_unaryContext) ast.Node {
826822
if opCtx.MINUS() != nil {
827823
// Negative number: -expr
828824
return &ast.A_Expr{
829-
Name: &ast.List{Items: []ast.Node{&ast.String{Str: "-"}}},
825+
Name: &ast.List{Items: []ast.Node{&ast.String{Str: "-"}}},
830826
Rexpr: expr,
831827
}
832828
}
@@ -837,7 +833,7 @@ func (c *cc) convertUnaryExpr(n *parser.Expr_unaryContext) ast.Node {
837833
if opCtx.TILDE() != nil {
838834
// Bitwise NOT: ~expr
839835
return &ast.A_Expr{
840-
Name: &ast.List{Items: []ast.Node{&ast.String{Str: "~"}}},
836+
Name: &ast.List{Items: []ast.Node{&ast.String{Str: "~"}}},
841837
Rexpr: expr,
842838
}
843839
}
@@ -1267,9 +1263,6 @@ func (c *cc) convert(node node) ast.Node {
12671263
case *parser.Delete_stmt_limitedContext:
12681264
return c.convertDelete_stmtContext(n)
12691265

1270-
case *parser.ExprContext:
1271-
return c.convertExprContext(n)
1272-
12731266
case *parser.Expr_functionContext:
12741267
return c.convertFuncContext(n)
12751268

internal/sql/ast/expr.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

internal/sql/astutils/rewrite.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,6 @@ func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast.
724724
a.apply(n, "Query", nil, n.Query)
725725
a.apply(n, "Options", nil, n.Options)
726726

727-
case *ast.Expr:
728-
// pass
729-
730727
case *ast.FetchStmt:
731728
// pass
732729

internal/sql/astutils/walk.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,9 +1134,6 @@ func Walk(f Visitor, node ast.Node) {
11341134
Walk(f, n.Options)
11351135
}
11361136

1137-
case *ast.Expr:
1138-
// pass
1139-
11401137
case *ast.FetchStmt:
11411138
// pass
11421139

0 commit comments

Comments
 (0)