We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4f944dd + 373a926 commit bc1ec47Copy full SHA for bc1ec47
src/sqlparser.rs
@@ -20,6 +20,7 @@ use super::dialect::keywords;
20
use super::dialect::Dialect;
21
use super::sqlast::*;
22
use super::sqltokenizer::*;
23
+use std::error::Error;
24
25
#[derive(Debug, Clone, PartialEq)]
26
pub enum ParserError {
@@ -47,6 +48,21 @@ impl From<TokenizerError> for ParserError {
47
48
}
49
50
51
+impl std::fmt::Display for ParserError {
52
+ fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
53
+ write!(
54
+ f,
55
+ "sql parser error: {}",
56
+ match self {
57
+ ParserError::TokenizerError(s) => s,
58
+ ParserError::ParserError(s) => s,
59
+ }
60
+ )
61
62
+}
63
+
64
+impl Error for ParserError {}
65
66
/// SQL Parser
67
pub struct Parser {
68
tokens: Vec<Token>,
0 commit comments