MCPcopy Create free account
hub / github.com/apache/datafusion / expected

Method expected

datafusion/sql/src/parser.rs:515–531  ·  view source on GitHub ↗

Report an unexpected token

(
        &self,
        expected: &str,
        found: &TokenWithSpan,
    )

Source from the content-addressed store, hash-verified

513
514 /// Report an unexpected token
515 fn expected<T>(
516 &self,
517 expected: &str,
518 found: &TokenWithSpan,
519 ) -> Result<T, DataFusionError> {
520 let sql_parser_span = found.span;
521 let span = Span::try_from_sqlparser_span(sql_parser_span);
522 let diagnostic = Diagnostic::new_error(
523 format!("Expected: {expected}, found: {found}{}", found.span.start),
524 span,
525 );
526 parser_err!(
527 format!("Expected: {expected}, found: {found}{}", found.span.start);
528 diagnostic=
529 diagnostic
530 )
531 }
532
533 fn expect_token(
534 &mut self,

Callers 13

parse_statementsMethod · 0.80
expect_tokenMethod · 0.80
parse_copyMethod · 0.80
parse_option_keyMethod · 0.80
parse_option_valueMethod · 0.80
parse_resetMethod · 0.80
parse_explain_formatMethod · 0.80
parse_partitionsMethod · 0.80
parse_columnsMethod · 0.80
parse_column_defMethod · 0.80
parse_file_formatMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected