Skip to content

Commit

Permalink
sqlparser: restructure the ast #480
Browse files Browse the repository at this point in the history
[summary]
In vitess, the AST visitor has been restructured, these work are worthy of reference.
The AST structs and interface implementations live in the ast.go, which is what the visitor generator reads to produce the visitor.
The rest of the AST functionality, all methods belonging to structs and not implementing any interfaces, now live in ast_funcs.go.

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go

[patch codecov]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 87.4%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_func.go 95.8%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parser.go 90.9%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go 92.0%
  • Loading branch information
zhyass committed Jun 1, 2020
1 parent 6167280 commit 9afdf23
Show file tree
Hide file tree
Showing 11 changed files with 1,974 additions and 1,935 deletions.
2,434 changes: 793 additions & 1,641 deletions src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go

Large diffs are not rendered by default.

878 changes: 878 additions & 0 deletions src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast_func.go

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/constants.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 0 additions & 23 deletions src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/explain.go

This file was deleted.

40 changes: 0 additions & 40 deletions src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/kill.go

This file was deleted.

29 changes: 29 additions & 0 deletions src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 101 additions & 0 deletions src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9afdf23

Please sign in to comment.