📝 Add docstrings to codex/encapsulate-token-utility-functions#31
Conversation
Docstrings generation was requested by @leynos. * #30 (comment) The following files were modified: * `src/parser/mod.rs` * `src/parser/span_collector.rs` * `src/parser/token_stream.rs`
Reviewer's GuideThis PR enriches the parser modules with comprehensive Rust doc comments—adding structured descriptions, Class diagram for updated parser utility types and methodsclassDiagram
class TokenStream {
+new(tokens: &[(SyntaxKind, Span)], src: &str) TokenStream
+cursor() usize
+peek() Option<(SyntaxKind, Span)>
+advance()
+tokens() &[(SyntaxKind, Span)]
+src() &str
+skip_until(end: usize)
+line_end(start: usize) usize
+skip_ws_inline()
}
class SpanCollector {
+new(tokens: &[(SyntaxKind, Span)], src: &str, extra: Extra) SpanCollector
spans: Vec<Span>
stream: TokenStream
extra: Extra
}
TokenStream <.. SpanCollector : used by
Class diagram for parser utility functions with enhanced docstringsclassDiagram
class parser {
+parse(src: &str) Parsed
+parse_tokens(tokens: &[(SyntaxKind, Span)], src: &str) (Vec<Span>, Vec<Span>, Vec<Simple<SyntaxKind>>)
+collect_import_spans(tokens: &[(SyntaxKind, Span)], src: &str) (Vec<Span>, Vec<Simple<SyntaxKind>>)
+collect_typedef_spans(tokens: &[(SyntaxKind, Span)], src: &str) Vec<Span>
}
parser ..> TokenStream : uses
parser ..> SpanCollector : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedCodeRabbit bot authored PR detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
38d16d9
into
codex/encapsulate-token-utility-functions
Docstrings generation was requested by @leynos. * #30 (comment) The following files were modified: * `src/parser/mod.rs` * `src/parser/span_collector.rs` * `src/parser/token_stream.rs` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Introduce TokenStream abstraction * Update rstest dependency * Refine TokenStream API * 📝 Add docstrings to `codex/encapsulate-token-utility-functions` (#31) Docstrings generation was requested by @leynos. * #30 (comment) The following files were modified: * `src/parser/mod.rs` * `src/parser/span_collector.rs` * `src/parser/token_stream.rs` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Add SpanCollector tests (#32) * Add SpanCollector tests * Rename test and document TokenStream usage * Simplify token stream control flow Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Spelling Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Docstrings generation was requested by @leynos.
The following files were modified:
src/parser/mod.rssrc/parser/span_collector.rssrc/parser/token_stream.rsThese file types are not supported
docs/ddlint-design-and-road-map.mdℹ️ Note
Summary by Sourcery
Add comprehensive Rust docstrings and inline examples to parser and token utility functions, as well as SpanCollector constructor.
Documentation:
Tests: