From ef5b4cb69b4eefb2945a1de819e2f95e3175bb51 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Sun, 26 Sep 2021 23:19:51 +0000 Subject: [PATCH] Potentially valid, not always valid. --- dicebot/src/basic/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dicebot/src/basic/parser.rs b/dicebot/src/basic/parser.rs index 9c5b83f..80f7f04 100644 --- a/dicebot/src/basic/parser.rs +++ b/dicebot/src/basic/parser.rs @@ -84,12 +84,12 @@ fn parse_keep_or_drop<'a>(input: &'a str, count: u32) -> IResult<&'a str, KeepOr use ParsedKeepOrDrop::*; let keep_drop: KeepOrDrop = match (keep, drop) { - //Valid Keep expression. + //Potential valid Keep expression. (Keep(keep), NotPresent) => match keep.parse().map_err(|_| too_big!(input))? { _i if _i > count || _i == 0 => Ok(KeepOrDrop::None), i => Ok(KeepOrDrop::Keep(i)), }, - //Valid Drop expression. + //Potential valid Drop expression. (NotPresent, Drop(drop)) => match drop.parse().map_err(|_| too_big!(input))? { _i if _i >= count => Ok(KeepOrDrop::None), i => Ok(KeepOrDrop::Drop(i)),