Add a placeholder for doing parser-recovery tests

This commit is contained in:
Savanni D'Gerinel 2023-10-18 23:23:10 -04:00
parent ebb28c3ae6
commit b0a467eda2
2 changed files with 10 additions and 1 deletions

View File

@ -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<String, i8>);

View File

@ -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.