Unnamed repository; edit this file 'description' to name the repository.
Add more doc
| -rw-r--r-- | lib/ungrammar/src/lib.rs | 6 |
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); |