Add a not yet implemented function.
This helps when creating new parsers since todo!()s will panic the whole parser.
This commit is contained in:
parent
ab7eb76e13
commit
a5585eb01f
@ -6,8 +6,6 @@ use nom::combinator::verify;
|
||||
use nom::multi::many_till;
|
||||
|
||||
use super::Context;
|
||||
use crate::error::CustomError;
|
||||
use crate::error::MyError;
|
||||
use crate::error::Res;
|
||||
use crate::parser::exiting::ExitClass;
|
||||
use crate::parser::object_parser::minimal_set_object;
|
||||
@ -16,14 +14,14 @@ use crate::parser::parser_context::ExitMatcherNode;
|
||||
use crate::parser::parser_with_context::parser_with_context;
|
||||
use crate::parser::util::exit_matcher_parser;
|
||||
use crate::parser::util::get_consumed;
|
||||
use crate::parser::util::not_yet_implemented;
|
||||
use crate::parser::RadioLink;
|
||||
use crate::parser::RadioTarget;
|
||||
|
||||
#[tracing::instrument(ret, level = "debug")]
|
||||
pub fn radio_link<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, RadioLink<'s>> {
|
||||
return Err(nom::Err::Error(CustomError::MyError(MyError(
|
||||
"Not implemented yet.",
|
||||
))));
|
||||
not_yet_implemented()?;
|
||||
todo!();
|
||||
}
|
||||
|
||||
#[tracing::instrument(ret, level = "debug")]
|
||||
|
@ -236,6 +236,13 @@ pub fn text_until_exit<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<
|
||||
))(input)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn not_yet_implemented() -> Res<&'static str, ()> {
|
||||
return Err(nom::Err::Error(CustomError::MyError(MyError(
|
||||
"Not implemented yet.",
|
||||
))));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
Loading…
x
Reference in New Issue
Block a user