aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-01-22 11:23:21 +0000
committerGitHub <[email protected]>2020-01-22 11:23:21 +0000
commita5407ddc05826b208ed8a0026b2ae566bf0a8b70 (patch)
treed9041707f979ed46fdb05a62a3875feee504a06b /crates/ra_parser/src
parentb982d60a4d512602b54f79b39119bde0f7e50f87 (diff)
parentfa31841f1f497f84ceb15c0a8636a2bf836705da (diff)
Merge #2891
2891: ra_syntax: removed code duplication and token reevaluation r=Veetaha a=Veetaha Just a small refactoring along the way of reading the codebase Co-authored-by: Veetaha <[email protected]>
Diffstat (limited to 'crates/ra_parser/src')
-rw-r--r--crates/ra_parser/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_parser/src/lib.rs b/crates/ra_parser/src/lib.rs
index 65134277e..81055746b 100644
--- a/crates/ra_parser/src/lib.rs
+++ b/crates/ra_parser/src/lib.rs
@@ -27,7 +27,7 @@ pub use syntax_kind::SyntaxKind;
27#[derive(Debug, Clone, PartialEq, Eq, Hash)] 27#[derive(Debug, Clone, PartialEq, Eq, Hash)]
28pub struct ParseError(pub String); 28pub struct ParseError(pub String);
29 29
30/// `TokenSource` abstracts the source of the tokens parser operates one. 30/// `TokenSource` abstracts the source of the tokens parser operates on.
31/// 31///
32/// Hopefully this will allow us to treat text and token trees in the same way! 32/// Hopefully this will allow us to treat text and token trees in the same way!
33pub trait TokenSource { 33pub trait TokenSource {
@@ -43,7 +43,7 @@ pub trait TokenSource {
43 fn is_keyword(&self, kw: &str) -> bool; 43 fn is_keyword(&self, kw: &str) -> bool;
44} 44}
45 45
46/// `TokenCursor` abstracts the cursor of `TokenSource` operates one. 46/// `Token` abstracts the cursor of `TokenSource` operates on.
47#[derive(Debug, Copy, Clone, Eq, PartialEq)] 47#[derive(Debug, Copy, Clone, Eq, PartialEq)]
48pub struct Token { 48pub struct Token {
49 /// What is the current token? 49 /// What is the current token?