aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/parser.rs
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2025-09-12 18:06:17 +0800
committer简律纯 <i@jyunko.cn>2025-09-12 18:06:17 +0800
commit183e39d9ebfe6e48e5ce666dee36b5347d47f53e (patch)
tree88a512d05a49d805be392a1113054297d3461188 /src/parser.rs
parentb8fa77736a3c3b9c9d898e7ffa87e057cfab005d (diff)
downloadOneRoll-183e39d9ebfe6e48e5ce666dee36b5347d47f53e.tar.gz
OneRoll-183e39d9ebfe6e48e5ce666dee36b5347d47f53e.zip
feat: add unique modifier to dice calculations and parsing
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 8f4633e..a1800a2 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -140,6 +140,9 @@ impl DiceParser {
.map_err(|_| DiceError::ParseError("无效的丢弃低数值".to_string()))?;
Ok(DiceModifier::DropLow(num))
}
+ Rule::unique => {
+ Ok(DiceModifier::Unique)
+ }
_ => Err(DiceError::ParseError("未知的修饰符".to_string())),
}
}