From 86a67dce25f11ba9803a5727f77c02fd1f49e2c0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 20 Feb 2019 16:48:06 +0300 Subject: fix tests --- crates/ra_syntax/src/parsing/reparsing.rs | 8 +++++--- crates/ra_syntax/src/syntax_kinds.rs | 3 ++- crates/tools/src/lib.rs | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs index a88f53dae..edf3fa291 100644 --- a/crates/ra_syntax/src/parsing/reparsing.rs +++ b/crates/ra_syntax/src/parsing/reparsing.rs @@ -79,10 +79,12 @@ fn is_contextual_kw(text: &str) -> bool { } } -type ParseFn = fn(&mut Parser); -fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(&SyntaxNode, ParseFn)> { +fn find_reparsable_node( + node: &SyntaxNode, + range: TextRange, +) -> Option<(&SyntaxNode, fn(&mut Parser))> { let node = algo::find_covering_node(node, range); - node.ancestors().find_map(grammar::reparser).map(|r| (node, r)) + node.ancestors().find_map(|node| grammar::reparser(node).map(|r| (node, r))) } fn is_balanced(tokens: &[Token]) -> bool { diff --git a/crates/ra_syntax/src/syntax_kinds.rs b/crates/ra_syntax/src/syntax_kinds.rs index d53886676..c1118c5ab 100644 --- a/crates/ra_syntax/src/syntax_kinds.rs +++ b/crates/ra_syntax/src/syntax_kinds.rs @@ -1,8 +1,9 @@ mod generated; -use crate::SyntaxKind::*; use std::fmt; +use crate::SyntaxKind::*; + pub use self::generated::SyntaxKind; impl fmt::Debug for SyntaxKind { diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index ef9c613a7..0a10d2737 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -14,7 +14,7 @@ pub use teraron::{Mode, Overwrite, Verify}; pub type Result = std::result::Result; pub const GRAMMAR: &str = "crates/ra_syntax/src/grammar.ron"; -const GRAMMAR_DIR: &str = "crates/ra_syntax/src/grammar"; +const GRAMMAR_DIR: &str = "crates/ra_syntax/src/parsing/grammar"; const OK_INLINE_TESTS_DIR: &str = "crates/ra_syntax/tests/data/parser/inline/ok"; const ERR_INLINE_TESTS_DIR: &str = "crates/ra_syntax/tests/data/parser/inline/err"; -- cgit v1.2.3