aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorChristopher Durham <[email protected]>2018-01-28 01:29:14 +0000
committerChristopher Durham <[email protected]>2018-01-28 01:29:14 +0000
commit50b9012e10d2fa74294547c25642b4a69fed4bda (patch)
tree6e930103a8b9e74041bf0e6e9f7c7e696d481afd /src/lib.rs
parent6d3caf58ca042cf6b5707822e51619adf511acd0 (diff)
Add minimal docs to most public symbols
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 39b01a1cb..87a9d11ea 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,20 @@
1//! An experimental implementation of [Rust RFC#2256 libsyntax2.0][rfc#2256].
2//!
3//! The intent is to be an IDE-ready parser, i.e. one that offers
4//!
5//! - easy and fast incremental re-parsing,
6//! - graceful handling of errors, and
7//! - maintains all information in the source file.
8//!
9//! For more information, see [the RFC][rfc#2265], or [the working draft][RFC.md].
10//!
11//! [rfc#2256]: <https://github.com/rust-lang/rfcs/pull/2256>
12//! [RFC.md]: <https://github.com/matklad/libsyntax2/blob/master/docs/RFC.md>
13
14#![forbid(missing_debug_implementations, unconditional_recursion, future_incompatible)]
15#![deny(bad_style, unsafe_code, missing_docs)]
16//#![warn(unreachable_pub)] // rust-lang/rust#47816
17
1extern crate unicode_xid; 18extern crate unicode_xid;
2 19
3mod text; 20mod text;
@@ -6,17 +23,20 @@ mod lexer;
6mod parser; 23mod parser;
7 24
8#[cfg_attr(rustfmt, rustfmt_skip)] 25#[cfg_attr(rustfmt, rustfmt_skip)]
26#[allow(missing_docs)]
9pub mod syntax_kinds; 27pub mod syntax_kinds;
10pub use text::{TextRange, TextUnit}; 28pub use text::{TextRange, TextUnit};
11pub use tree::{File, FileBuilder, Node, Sink, SyntaxKind, Token}; 29pub use tree::{File, FileBuilder, Node, Sink, SyntaxKind, Token};
12pub use lexer::{next_token, tokenize}; 30pub use lexer::{next_token, tokenize};
13pub use parser::parse; 31pub use parser::parse;
14 32
33/// Utilities for simple uses of the parser.
15pub mod utils { 34pub mod utils {
16 use std::fmt::Write; 35 use std::fmt::Write;
17 36
18 use {File, Node}; 37 use {File, Node};
19 38
39 /// Parse a file and create a string representation of the resulting parse tree.
20 pub fn dump_tree(file: &File) -> String { 40 pub fn dump_tree(file: &File) -> String {
21 let mut result = String::new(); 41 let mut result = String::new();
22 go(file.root(), &mut result, 0); 42 go(file.root(), &mut result, 0);