diff options
author | csmoe <[email protected]> | 2018-12-31 12:53:43 +0000 |
---|---|---|
committer | csmoe <[email protected]> | 2018-12-31 13:00:05 +0000 |
commit | ea7b569e1b133b6c19ef60c9cb2b2fd6b79847da (patch) | |
tree | 8c2ad080054f30104c1da78f16aa3d3d5185a49d /crates/ra_syntax/src/parser_impl.rs | |
parent | 582ea0a29a2914ab0b6847121b91396a4e8bebc5 (diff) |
docing parser methods
Diffstat (limited to 'crates/ra_syntax/src/parser_impl.rs')
-rw-r--r-- | crates/ra_syntax/src/parser_impl.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/parser_impl.rs b/crates/ra_syntax/src/parser_impl.rs index cb6e370ac..d4032a6d9 100644 --- a/crates/ra_syntax/src/parser_impl.rs +++ b/crates/ra_syntax/src/parser_impl.rs | |||
@@ -22,10 +22,21 @@ use crate::SyntaxKind::{self, EOF, TOMBSTONE}; | |||
22 | pub(crate) trait Sink { | 22 | pub(crate) trait Sink { |
23 | type Tree; | 23 | type Tree; |
24 | 24 | ||
25 | /// Adds new leaf to the current branch. | ||
25 | fn leaf(&mut self, kind: SyntaxKind, text: SmolStr); | 26 | fn leaf(&mut self, kind: SyntaxKind, text: SmolStr); |
26 | fn start_internal(&mut self, kind: SyntaxKind); | 27 | |
27 | fn finish_internal(&mut self); | 28 | /// Start new branch and make it current. |
29 | fn start_branch(&mut self, kind: SyntaxKind); | ||
30 | |||
31 | /// Finish current branch and restore previous | ||
32 | /// branch as current. | ||
33 | fn finish_branch(&mut self); | ||
34 | |||
28 | fn error(&mut self, error: SyntaxError); | 35 | fn error(&mut self, error: SyntaxError); |
36 | |||
37 | /// Complete tree building. Make sure that | ||
38 | /// `start_branch` and `finish_branch` calls | ||
39 | /// are paired! | ||
29 | fn finish(self) -> Self::Tree; | 40 | fn finish(self) -> Self::Tree; |
30 | } | 41 | } |
31 | 42 | ||