Add even more docs

This commit is contained in:
Aleksey Kladov 2021-05-22 17:20:22 +03:00
parent 188b0f96f9
commit dc1577d58d
22 changed files with 13 additions and 36 deletions

View file

@ -1,4 +1,4 @@
//! FIXME: write short doc here //! See [`Name`].
use std::fmt; use std::fmt;

View file

@ -1,4 +1,6 @@
//! FIXME: write short doc here //! Our parser is generic over the source of tokens it parses.
//!
//! This module defines tokens sourced from declarative macros.
use parser::{Token, TokenSource}; use parser::{Token, TokenSource};
use syntax::{lex_single_syntax_kind, SmolStr, SyntaxKind, SyntaxKind::*, T}; use syntax::{lex_single_syntax_kind, SmolStr, SyntaxKind, SyntaxKind::*, T};

View file

@ -1,4 +1,4 @@
//! FIXME: write short doc here //! Conversions between [`SyntaxNode`] and [`tt::TokenTree`].
use parser::{FragmentKind, ParseError, TreeSink}; use parser::{FragmentKind, ParseError, TreeSink};
use rustc_hash::FxHashMap; use rustc_hash::FxHashMap;

View file

@ -1,4 +1,5 @@
//! FIXME: write short doc here //! A "Parser" structure for token trees. We use this when parsing a declarative
//! macro definition into a list of patterns and templates.
use crate::{subtree_source::SubtreeTokenSource, ExpandError, ExpandResult}; use crate::{subtree_source::SubtreeTokenSource, ExpandError, ExpandResult};

View file

@ -27,6 +27,7 @@
//! node or an error, rules like `opt_where_clause` may produce nothing. //! node or an error, rules like `opt_where_clause` may produce nothing.
//! Non-opt rules typically start with `assert!(p.at(FIRST_TOKEN))`, the //! Non-opt rules typically start with `assert!(p.at(FIRST_TOKEN))`, the
//! caller is responsible for branching on the first token. //! caller is responsible for branching on the first token.
mod attributes; mod attributes;
mod expressions; mod expressions;
mod items; mod items;

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
pub(super) fn inner_attrs(p: &mut Parser) { pub(super) fn inner_attrs(p: &mut Parser) {

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
mod atom; mod atom;
pub(crate) use self::atom::{block_expr, match_arm_list}; pub(crate) use self::atom::{block_expr, match_arm_list};

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
// test expr_literals // test expr_literals

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
mod consts; mod consts;
mod adt; mod adt;
mod traits; mod traits;

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
pub(super) fn strukt(p: &mut Parser, m: Marker) { pub(super) fn strukt(p: &mut Parser, m: Marker) {

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
pub(super) fn static_(p: &mut Parser, m: Marker) { pub(super) fn static_(p: &mut Parser, m: Marker) {

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
// test trait_item // test trait_item

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
pub(super) fn use_(p: &mut Parser, m: Marker) { pub(super) fn use_(p: &mut Parser, m: Marker) {

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
// test param_list // test param_list

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
pub(super) const PATH_FIRST: TokenSet = pub(super) const PATH_FIRST: TokenSet =

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
pub(super) const PATTERN_FIRST: TokenSet = pub(super) const PATTERN_FIRST: TokenSet =

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
pub(super) fn opt_generic_arg_list(p: &mut Parser, colon_colon_required: bool) { pub(super) fn opt_generic_arg_list(p: &mut Parser, colon_colon_required: bool) {

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
pub(super) fn opt_generic_param_list(p: &mut Parser) { pub(super) fn opt_generic_param_list(p: &mut Parser) {

View file

@ -1,5 +1,3 @@
//! FIXME: write short doc here
use super::*; use super::*;
pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(TokenSet::new(&[ pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(TokenSet::new(&[

View file

@ -1,4 +1,4 @@
//! FIXME: write short doc here //! See [`Parser`].
use std::cell::Cell; use std::cell::Cell;

View file

@ -1,4 +1,5 @@
//! FIXME: write short doc here //! Defines [`SyntaxKind`] -- a fieldless enum of all possible syntactic
//! constructs of the Rust language.
#[macro_use] #[macro_use]
mod generated; mod generated;

View file

@ -348,7 +348,7 @@ struct TidyDocs {
impl TidyDocs { impl TidyDocs {
fn visit(&mut self, path: &Path, text: &str) { fn visit(&mut self, path: &Path, text: &str) {
// Tests and diagnostic fixes don't need module level comments. // Tests and diagnostic fixes don't need module level comments.
if is_exclude_dir(path, &["tests", "test_data", "fixes"]) { if is_exclude_dir(path, &["tests", "test_data", "fixes", "grammar"]) {
return; return;
} }
@ -392,7 +392,7 @@ impl TidyDocs {
) )
} }
let poorly_documented = ["hir_expand", "mbe", "parser", "hir_ty"]; let poorly_documented = ["hir_ty"];
let mut has_fixmes = let mut has_fixmes =
poorly_documented.iter().map(|it| (*it, false)).collect::<HashMap<&str, bool>>(); poorly_documented.iter().map(|it| (*it, false)).collect::<HashMap<&str, bool>>();