Unnamed repository; edit this file 'description' to name the repository.
Add more doc
Ariel Davis 2021-01-22
parent be849cf · commit 67a8915
-rw-r--r--lib/ungrammar/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ungrammar/src/lib.rs b/lib/ungrammar/src/lib.rs
index eb1feaa340..858b680c81 100644
--- a/lib/ungrammar/src/lib.rs
+++ b/lib/ungrammar/src/lib.rs
@@ -26,10 +26,16 @@ pub fn rust_grammar() -> Grammar {
}
/// A node, like `A = 'b' | 'c'`.
+///
+/// Indexing into a [`Grammar`] with a [`Node`] returns a reference to a
+/// [`NodeData`].
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Node(usize);
/// A token, denoted with single quotes, like `'+'` or `'struct'`.
+///
+/// Indexing into a [`Grammar`] with a [`Token`] returns a reference to a
+/// [`TokenData`].
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Token(usize);