Skip to content

Commit

Permalink
Merge pull request #64 from gwenn/no_error_recovery
Browse files Browse the repository at this point in the history
Fix sql_cmds example
  • Loading branch information
gwenn committed Aug 4, 2024
2 parents af9d173 + f34998d commit 1e0fb76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/sql_cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ use std::env;
use std::fs::read;
use std::panic;

use sqlite3_parser::lexer::sql::{Error, Parser};
#[cfg(not(feature = "YYNOERRORRECOVERY"))]
use sqlite3_parser::lexer::sql::Error;
use sqlite3_parser::lexer::sql::Parser;

/// Parse specified files and print all commands.
fn main() {
Expand All @@ -19,6 +21,9 @@ fn main() {
Ok(None) => break,
Err(err) => {
eprintln!("Err: {err} in {arg}");
#[cfg(feature = "YYNOERRORRECOVERY")]
break;
#[cfg(not(feature = "YYNOERRORRECOVERY"))]
if let Error::ParserError(..) = err {
} else {
break;
Expand Down

0 comments on commit 1e0fb76

Please sign in to comment.