mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-09 21:42:05 +00:00
Implement Spanned
to retrieve source locations on AST nodes (#1435)
Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com> Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
parent
0adec33b94
commit
3c8fd74804
18 changed files with 3092 additions and 399 deletions
|
@ -21,6 +21,8 @@
|
|||
#[macro_use]
|
||||
mod test_utils;
|
||||
|
||||
use helpers::attached_token::AttachedToken;
|
||||
use sqlparser::tokenizer::Span;
|
||||
use test_utils::*;
|
||||
|
||||
use sqlparser::ast::Expr::{BinaryOp, Identifier, MapAccess};
|
||||
|
@ -39,12 +41,14 @@ fn parse_map_access_expr() {
|
|||
assert_eq!(
|
||||
Select {
|
||||
distinct: None,
|
||||
select_token: AttachedToken::empty(),
|
||||
top: None,
|
||||
top_before_distinct: false,
|
||||
projection: vec![UnnamedExpr(MapAccess {
|
||||
column: Box::new(Identifier(Ident {
|
||||
value: "string_values".to_string(),
|
||||
quote_style: None,
|
||||
span: Span::empty(),
|
||||
})),
|
||||
keys: vec![MapAccessKey {
|
||||
key: call(
|
||||
|
@ -903,7 +907,8 @@ fn parse_create_view_with_fields_data_types() {
|
|||
data_type: Some(DataType::Custom(
|
||||
ObjectName(vec![Ident {
|
||||
value: "int".into(),
|
||||
quote_style: Some('"')
|
||||
quote_style: Some('"'),
|
||||
span: Span::empty(),
|
||||
}]),
|
||||
vec![]
|
||||
)),
|
||||
|
@ -914,7 +919,8 @@ fn parse_create_view_with_fields_data_types() {
|
|||
data_type: Some(DataType::Custom(
|
||||
ObjectName(vec![Ident {
|
||||
value: "String".into(),
|
||||
quote_style: Some('"')
|
||||
quote_style: Some('"'),
|
||||
span: Span::empty(),
|
||||
}]),
|
||||
vec![]
|
||||
)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue