diff --git a/error-training/src/flow.rs b/error-training/src/flow.rs index 12f07ba..d5c9c2f 100644 --- a/error-training/src/flow.rs +++ b/error-training/src/flow.rs @@ -3,7 +3,7 @@ //! FatalError, Error>. use super::*; -use ::result_extended::{error, fatal, ok, return_error, return_fatal, Result}; +use ::result_extended::{error, fatal, ok, return_fatal, Result}; use std::collections::HashMap; pub struct DB(HashMap); diff --git a/error-training/src/parser-recovery.rs b/error-training/src/parser-recovery.rs new file mode 100644 index 0000000..d4e3657 --- /dev/null +++ b/error-training/src/parser-recovery.rs @@ -0,0 +1,9 @@ +//! Let's figure out a recovery mechanism in terms of a parser. For this example I'm going to +//! assume an SGF parser in which a player's rank is specified in some non-standard, but still +//! somewhat comprehensible, way. +//! +//! Correct: 5d +//! Incorrect, but recoverable: 5 Dan +//! +//! In strict mode, the incorrect one would be rejected. In permissive mode, the incorrect one +//! would be corrected. I don't know that this actually makes any sense in this context, though.