mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
add minimal comments
This commit is contained in:
parent
0e1e40676a
commit
ab19ff16e5
5 changed files with 13 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
//! Abstract Syntax Tree, layered on top of untyped `SyntaxNode`s
|
//! Abstract Syntax Tree, layered on top of untyped `SyntaxNode`s
|
||||||
|
|
||||||
mod generated;
|
mod generated;
|
||||||
mod traits;
|
mod traits;
|
||||||
mod tokens;
|
mod tokens;
|
||||||
|
@ -44,6 +45,7 @@ pub trait AstToken<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// An iterator over `SyntaxNode` children of a particular AST type.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct AstChildren<'a, N> {
|
pub struct AstChildren<'a, N> {
|
||||||
inner: SyntaxNodeChildren<'a>,
|
inner: SyntaxNodeChildren<'a>,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Various extension methods to ast Expr Nodes, which are hard to code-generate.
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
SyntaxToken, SyntaxElement, SmolStr,
|
SyntaxToken, SyntaxElement, SmolStr,
|
||||||
ast::{self, AstNode, AstChildren, children, child_opt},
|
ast::{self, AstNode, AstChildren, children, child_opt},
|
||||||
|
|
|
@ -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 itertools::Itertools;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! There are many AstNodes, but only a few tokens, so we hand-write them here.
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
SyntaxToken,
|
SyntaxToken,
|
||||||
SyntaxKind::{COMMENT, WHITESPACE},
|
SyntaxKind::{COMMENT, WHITESPACE},
|
||||||
|
|
|
@ -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 itertools::Itertools;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue