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.
1 parent 4f944dd commit 22adc73Copy full SHA for 22adc73
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,17 @@ 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!(f, "sql parser error: {}", match self {
54
+ ParserError::TokenizerError(s) => s,
55
+ ParserError::ParserError(s) => s,
56
+ })
57
+ }
58
+}
59
+
60
+impl Error for ParserError {}
61
62
/// SQL Parser
63
pub struct Parser {
64
tokens: Vec<Token>,
0 commit comments