diff options
Diffstat (limited to 'crates/syntax')
-rw-r--r-- | crates/syntax/fuzz/fuzz_targets/parser.rs | 2 | ||||
-rw-r--r-- | crates/syntax/fuzz/fuzz_targets/reparse.rs | 2 | ||||
-rw-r--r-- | crates/syntax/src/algo.rs | 2 | ||||
-rw-r--r-- | crates/syntax/src/fuzz.rs | 4 | ||||
-rw-r--r-- | crates/syntax/src/parsing/text_tree_sink.rs | 2 | ||||
-rw-r--r-- | crates/syntax/src/ptr.rs | 11 |
6 files changed, 17 insertions, 6 deletions
diff --git a/crates/syntax/fuzz/fuzz_targets/parser.rs b/crates/syntax/fuzz/fuzz_targets/parser.rs index 386768343..f80e13002 100644 --- a/crates/syntax/fuzz/fuzz_targets/parser.rs +++ b/crates/syntax/fuzz/fuzz_targets/parser.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! Fuzzing for from-scratch parsing. |
2 | 2 | ||
3 | #![no_main] | 3 | #![no_main] |
4 | use libfuzzer_sys::fuzz_target; | 4 | use libfuzzer_sys::fuzz_target; |
diff --git a/crates/syntax/fuzz/fuzz_targets/reparse.rs b/crates/syntax/fuzz/fuzz_targets/reparse.rs index 5ac99fdaf..f865ce8d6 100644 --- a/crates/syntax/fuzz/fuzz_targets/reparse.rs +++ b/crates/syntax/fuzz/fuzz_targets/reparse.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! Fuzzing for incremental parsing. |
2 | 2 | ||
3 | #![no_main] | 3 | #![no_main] |
4 | use libfuzzer_sys::fuzz_target; | 4 | use libfuzzer_sys::fuzz_target; |
diff --git a/crates/syntax/src/algo.rs b/crates/syntax/src/algo.rs index 241713c48..8d7a77b50 100644 --- a/crates/syntax/src/algo.rs +++ b/crates/syntax/src/algo.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! Collection of assorted algorithms for syntax trees. |
2 | 2 | ||
3 | use std::{hash::BuildHasherDefault, ops::RangeInclusive}; | 3 | use std::{hash::BuildHasherDefault, ops::RangeInclusive}; |
4 | 4 | ||
diff --git a/crates/syntax/src/fuzz.rs b/crates/syntax/src/fuzz.rs index aa84239d2..256999fe0 100644 --- a/crates/syntax/src/fuzz.rs +++ b/crates/syntax/src/fuzz.rs | |||
@@ -1,4 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! Some infrastructure for fuzzy testing. |
2 | //! | ||
3 | //! We don't normally run fuzzying, so this is hopelessly bitrotten :( | ||
2 | 4 | ||
3 | use std::{ | 5 | use std::{ |
4 | convert::TryInto, | 6 | convert::TryInto, |
diff --git a/crates/syntax/src/parsing/text_tree_sink.rs b/crates/syntax/src/parsing/text_tree_sink.rs index d63ec080b..25bfd41a1 100644 --- a/crates/syntax/src/parsing/text_tree_sink.rs +++ b/crates/syntax/src/parsing/text_tree_sink.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! See [`TextTreeSink`]. |
2 | 2 | ||
3 | use std::mem; | 3 | use std::mem; |
4 | 4 | ||
diff --git a/crates/syntax/src/ptr.rs b/crates/syntax/src/ptr.rs index d3fb7a5d9..195d2251b 100644 --- a/crates/syntax/src/ptr.rs +++ b/crates/syntax/src/ptr.rs | |||
@@ -1,4 +1,13 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! In rust-analyzer, syntax trees are transient objects. |
2 | //! | ||
3 | //! That means that we create trees when we need them, and tear them down to | ||
4 | //! save memory. In this architecture, hanging on to a particular syntax node | ||
5 | //! for a long time is ill-advisable, as that keeps the whole tree resident. | ||
6 | //! | ||
7 | //! Instead, we provide a [`SyntaxNodePtr`] type, which stores information about | ||
8 | //! *location* of a particular syntax node in a tree. Its a small type which can | ||
9 | //! be cheaply stored, and which can be resolved to a real [`SyntaxNode`] when | ||
10 | //! necessary. | ||
2 | 11 | ||
3 | use std::{ | 12 | use std::{ |
4 | hash::{Hash, Hasher}, | 13 | hash::{Hash, Hasher}, |