aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/make.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/make.rs')
-rw-r--r--crates/ra_syntax/src/ast/make.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs
index 22c54f363..f25b526b6 100644
--- a/crates/ra_syntax/src/ast/make.rs
+++ b/crates/ra_syntax/src/ast/make.rs
@@ -240,22 +240,13 @@ fn unroot(n: SyntaxNode) -> SyntaxNode {
240} 240}
241 241
242pub mod tokens { 242pub mod tokens {
243 use crate::{ast, AstNode, Parse, SourceFile, SyntaxKind::*, SyntaxToken, T};
244 use once_cell::sync::Lazy; 243 use once_cell::sync::Lazy;
245 244
245 use crate::{ast, AstNode, Parse, SourceFile, SyntaxKind::*, SyntaxToken};
246
246 pub(super) static SOURCE_FILE: Lazy<Parse<SourceFile>> = 247 pub(super) static SOURCE_FILE: Lazy<Parse<SourceFile>> =
247 Lazy::new(|| SourceFile::parse("const C: <()>::Item = (1 != 1, 2 == 2, !true)\n;")); 248 Lazy::new(|| SourceFile::parse("const C: <()>::Item = (1 != 1, 2 == 2, !true)\n;"));
248 249
249 pub fn comma() -> SyntaxToken {
250 SOURCE_FILE
251 .tree()
252 .syntax()
253 .descendants_with_tokens()
254 .filter_map(|it| it.into_token())
255 .find(|it| it.kind() == T![,])
256 .unwrap()
257 }
258
259 pub fn single_space() -> SyntaxToken { 250 pub fn single_space() -> SyntaxToken {
260 SOURCE_FILE 251 SOURCE_FILE
261 .tree() 252 .tree()