fix tests

This commit is contained in:
Aleksey Kladov 2019-02-20 16:48:06 +03:00
parent 45fc91cc47
commit 86a67dce25
3 changed files with 8 additions and 5 deletions

View file

@ -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 {

View file

@ -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 {