+#![allow(dead_code)]
use std::{fmt::Write, sync::OnceLock};
use flagset::{flags, FlagSet};
println!("{}:{}", file!(), line!());
(command.run)(&mut context);
println!("{}:{}", file!(), line!());
- end_of_command(&context);
+ let _ = end_of_command(&context);
println!("{}:{}", file!(), line!());
}
println!("{}:{}", file!(), line!());
+#![allow(dead_code)]
use std::{
fmt::{Display, Formatter, Result as FmtResult},
ops::RangeInclusive,
pub missing_words: isize,
}
-fn count_words(s: &str) -> isize {
- s.split_whitespace().count() as isize
-}
-
/// Compares `string` obtained from the user against the full name of a `command`,
/// using this algorithm:
///
error_handling: ErrorHandling,
/// Encoding.
+ #[allow(dead_code)]
encoding: &'static Encoding,
/// `None` if this reader is not associated with a file.
return self.merge(true).unwrap();
};
let (s, rest) = self.input.split_at(seg_len);
- self.input = rest;
match ScanToken::from_segment(s, seg_type) {
- Some(ScanToken::Error(error)) => return Some(ScanToken::Error(error)),
+ Some(ScanToken::Error(error)) => {
+ if let Ok(Some(token)) = self.merge(true) {
+ return Some(token);
+ }
+ self.input = rest;
+ return Some(ScanToken::Error(error))
+ },
Some(ScanToken::Token(token)) => {
self.tokens.push_back(token);
}
None => (),
}
+ self.input = rest;
}
}
}
ScanToken::Token(Token::String(String::from("content line 1"))),
ScanToken::Token(Token::String(String::from("content line 2"))),
ScanToken::Token(Token::End),
- ScanToken::Token(Token::End),
],
);
}
+#![allow(dead_code)]
use lazy_static::lazy_static;
use num::Integer;
use std::{
+#![allow(dead_code)]
use std::sync::Arc;
use self::pivot::Value;