Skip to content

Commit fcaf4cd

Browse files
committed
fix(lance_parser): remove #[macro_export] pollution, fix CypherQuery collision
Item 4: Remove #[macro_export] from lance_plan_err!, lance_config_err!, lance_exec_err! — these are bouncer-internal macros, not crate-level. Only used in lance_parser/error.rs tests. Item 5: Replace `pub use ast::*` glob re-export with explicit re-exports excluding CypherQuery. lance_parser::ast::CypherQuery and cypher.rs::CypherQuery are different types serving different roles — the glob made them collide at the query module level. Now the bouncer's CypherQuery stays behind lance_parser::ast:: and the old cypher.rs CypherQuery owns the unqualified name. 105/105 lance_parser tests pass. 6/6 error tests pass. https://claude.ai/code/session_018L7tAcJ9ppReFdcjhYjTcb
1 parent 3d3ddb0 commit fcaf4cd

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/query/lance_parser/error.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,20 @@ pub fn exec_err_at(message: String) -> GraphError {
7979
/// ```ignore
8080
/// let err = lance_plan_err!("Cannot join {} to {}", left, right);
8181
/// ```
82-
#[macro_export]
8382
macro_rules! lance_plan_err {
8483
($($arg:tt)*) => {
8584
$crate::query::lance_parser::error::plan_err_at(format!($($arg)*))
8685
};
8786
}
8887

8988
/// Create a ConfigError with zero-cost location capture.
90-
#[macro_export]
9189
macro_rules! lance_config_err {
9290
($($arg:tt)*) => {
9391
$crate::query::lance_parser::error::config_err_at(format!($($arg)*))
9492
};
9593
}
9694

9795
/// Create an ExecutionError with zero-cost location capture.
98-
#[macro_export]
9996
macro_rules! lance_exec_err {
10097
($($arg:tt)*) => {
10198
$crate::query::lance_parser::error::exec_err_at(format!($($arg)*))

src/query/lance_parser/mod.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,16 @@ pub mod parameter_substitution;
1515
pub mod parser;
1616
pub mod semantic;
1717

18-
// Re-export the main entry points
19-
pub use ast::*;
18+
// Re-export the main entry points.
19+
// NOTE: ast::CypherQuery deliberately excluded to avoid collision with
20+
// cypher.rs::CypherQuery. Use lance_parser::ast::CypherQuery if needed.
21+
pub use ast::{
22+
ArithmeticOperator, BooleanExpression, ComparisonOperator, DistanceMetric,
23+
FunctionType, GraphPattern, LengthRange, MatchClause, NodePattern, OrderByClause,
24+
OrderByItem, PathPattern, PathSegment, PropertyRef, PropertyValue, ReadingClause,
25+
RelationshipDirection, RelationshipPattern, ReturnClause, ReturnItem, SortDirection,
26+
UnwindClause, ValueExpression, WhereClause, WithClause, classify_function,
27+
};
2028
pub use error::{GraphError, Result};
2129
pub use parameter_substitution::ParamValue;
2230
pub use parser::parse_cypher_query;

0 commit comments

Comments
 (0)