fix tests
This commit is contained in:
parent
45fc91cc47
commit
86a67dce25
3 changed files with 8 additions and 5 deletions
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -14,7 +14,7 @@ pub use teraron::{Mode, Overwrite, Verify};
|
|||
pub type Result<T> = std::result::Result<T, failure::Error>;
|
||||
|
||||
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";
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue