Skip to content

Commit

Permalink
Tweak a few docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gawdl3y committed Mar 18, 2024
1 parent 95b8123 commit 1421b3a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/dice.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![allow(clippy::tabs_in_doc_comments)]

//! All functionality for directly creating dice, rolling them, and working with their resulting rolls.
//!
//! This is the home of the dice "primitives". For using as part of a larger expression, see [`Term::dice`].
//!
//! [`Term::dice`]: ../term/enum.Term.html#variant.Dice
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#![allow(clippy::tabs_in_doc_comments)]

//! A library for parsing, rolling, and explaining the results of tabletop dice. Dice modifiers use a similar syntax to
//! [FoundryVTT's modifiers].
//!
//! [FoundryVTT's modifiers]: https://foundryvtt.com/article/dice-modifiers/
pub mod dice;
pub mod term;

Expand Down
4 changes: 2 additions & 2 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use crate::{
term::Term,
};

/// Generates a parser that specifically handles dice terms like "d20", "2d20kh", "8d6x", etc.
/// Generates a parser that specifically handles dice with or without modifiers like "d20", "2d20kh", "8d6x", etc.
pub fn dice_part<'src>() -> impl Parser<'src, &'src str, Dice, extra::Err<Rich<'src, char>>> + Copy {
// Parser for dice expressions
text::int(10)
Expand All @@ -69,7 +69,7 @@ pub fn dice_part<'src>() -> impl Parser<'src, &'src str, Dice, extra::Err<Rich<'
})
}

/// Generates a parser that specifically handles dice terms like "d20", "2d20kh", "8d6x", etc.
/// Generates a parser that specifically handles dice with or without modifiers like "d20", "2d20kh", "8d6x", etc.
/// and expects end of input
pub fn dice<'src>() -> impl Parser<'src, &'src str, Dice, extra::Err<Rich<'src, char>>> + Copy {
dice_part().then_ignore(end())
Expand Down

0 comments on commit 1421b3a

Please sign in to comment.