From ab19ff16e55d4d64445fc2809e52d913ad492040 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 2 Apr 2019 13:02:23 +0300 Subject: add minimal comments --- crates/ra_syntax/src/ast.rs | 2 ++ crates/ra_syntax/src/ast/expr_extensions.rs | 2 ++ crates/ra_syntax/src/ast/extensions.rs | 3 +++ crates/ra_syntax/src/ast/tokens.rs | 2 ++ crates/ra_syntax/src/ast/traits.rs | 4 ++++ 5 files changed, 13 insertions(+) (limited to 'crates/ra_syntax/src') diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index dcc71eabe..9f5c41b0c 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs @@ -1,4 +1,5 @@ //! Abstract Syntax Tree, layered on top of untyped `SyntaxNode`s + mod generated; mod traits; mod tokens; @@ -44,6 +45,7 @@ pub trait AstToken<'a> { } } +/// An iterator over `SyntaxNode` children of a particular AST type. #[derive(Debug)] pub struct AstChildren<'a, N> { inner: SyntaxNodeChildren<'a>, diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index b24f86cec..1d8313810 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs @@ -1,3 +1,5 @@ +//! Various extension methods to ast Expr Nodes, which are hard to code-generate. + use crate::{ SyntaxToken, SyntaxElement, SmolStr, ast::{self, AstNode, AstChildren, children, child_opt}, diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index 342581faf..aec57c380 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs @@ -1,3 +1,6 @@ +//! Various extension methods to ast Nodes, which are hard to code-generate. +//! Extensions for various expressions live in a sibling `expr_extensions` module. + use itertools::Itertools; use crate::{ diff --git a/crates/ra_syntax/src/ast/tokens.rs b/crates/ra_syntax/src/ast/tokens.rs index 7c30ff15c..da7d507bf 100644 --- a/crates/ra_syntax/src/ast/tokens.rs +++ b/crates/ra_syntax/src/ast/tokens.rs @@ -1,3 +1,5 @@ +//! There are many AstNodes, but only a few tokens, so we hand-write them here. + use crate::{ SyntaxToken, SyntaxKind::{COMMENT, WHITESPACE}, diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs index 98aa22085..aaf07d731 100644 --- a/crates/ra_syntax/src/ast/traits.rs +++ b/crates/ra_syntax/src/ast/traits.rs @@ -1,3 +1,7 @@ +//! Various traits that are implemented by ast nodes. +//! +//! The implementations are usually trivial, and live in generated.rs + use itertools::Itertools; use crate::{ -- cgit v1.2.3