Skip to content

Commit 1c3fcf2

Browse files
authored
Merge pull request #5000 from andylokandy/refactor
chore(parser): rearrange file structure of common_ast
2 parents 40fc1b9 + c503d75 commit 1c3fcf2

File tree

27 files changed

+323
-737
lines changed

27 files changed

+323
-737
lines changed

common/ast/src/parser/ast/expression.rs renamed to common/ast/src/ast/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ use std::fmt::Formatter;
1717

1818
use sqlparser::ast::Value;
1919

20-
use super::Identifier;
21-
use super::Query;
22-
use crate::parser::ast::display_identifier_vec;
20+
use crate::ast::display_identifier_vec;
21+
use crate::ast::Identifier;
22+
use crate::ast::Query;
2323

2424
#[derive(Debug, Clone, PartialEq)]
2525
#[allow(dead_code)]

common/ast/src/parser/ast/mod.rs renamed to common/ast/src/ast/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
mod ast_visitor;
16-
mod expression;
15+
mod expr;
1716
mod query;
1817
mod statement;
1918

2019
use std::fmt::Display;
2120
use std::fmt::Formatter;
2221

23-
pub use expression::*;
22+
pub use expr::*;
2423
pub use query::*;
2524
pub use statement::*;
2625

common/ast/src/parser/ast/query.rs renamed to common/ast/src/ast/query.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
use std::fmt::Display;
1616
use std::fmt::Formatter;
1717

18-
use crate::parser::ast::display_identifier_vec;
19-
use crate::parser::ast::Expr;
20-
use crate::parser::ast::Identifier;
18+
use crate::ast::display_identifier_vec;
19+
use crate::ast::Expr;
20+
use crate::ast::Identifier;
2121

2222
// Root node of a query tree
2323
#[derive(Debug, Clone, PartialEq)]

common/ast/src/parser/ast/statement.rs renamed to common/ast/src/ast/statement.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
use std::fmt::Display;
1616
use std::fmt::Formatter;
1717

18-
use super::expression::Literal;
19-
use super::expression::TypeName;
20-
use super::Identifier;
21-
use crate::parser::ast::display_identifier_vec;
22-
use crate::parser::ast::query::Query;
18+
use crate::ast::display_identifier_vec;
19+
use crate::ast::expr::Literal;
20+
use crate::ast::expr::TypeName;
21+
use crate::ast::Identifier;
22+
use crate::ast::Query;
2323

2424
// SQL statement
2525
#[derive(Debug, Clone, PartialEq)]

common/ast/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
pub mod ast;
1516
pub mod parser;
1617
pub mod udfs;

0 commit comments

Comments
 (0)