mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 19:58:32 +00:00
fix tests
This commit is contained in:
parent
45fc91cc47
commit
86a67dce25
@ -79,10 +79,12 @@ fn is_contextual_kw(text: &str) -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type ParseFn = fn(&mut Parser);
|
fn find_reparsable_node(
|
||||||
fn find_reparsable_node(node: &SyntaxNode, range: TextRange) -> Option<(&SyntaxNode, ParseFn)> {
|
node: &SyntaxNode,
|
||||||
|
range: TextRange,
|
||||||
|
) -> Option<(&SyntaxNode, fn(&mut Parser))> {
|
||||||
let node = algo::find_covering_node(node, range);
|
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 {
|
fn is_balanced(tokens: &[Token]) -> bool {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
mod generated;
|
mod generated;
|
||||||
|
|
||||||
use crate::SyntaxKind::*;
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
|
use crate::SyntaxKind::*;
|
||||||
|
|
||||||
pub use self::generated::SyntaxKind;
|
pub use self::generated::SyntaxKind;
|
||||||
|
|
||||||
impl fmt::Debug for 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 type Result<T> = std::result::Result<T, failure::Error>;
|
||||||
|
|
||||||
pub const GRAMMAR: &str = "crates/ra_syntax/src/grammar.ron";
|
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 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";
|
const ERR_INLINE_TESTS_DIR: &str = "crates/ra_syntax/tests/data/parser/inline/err";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user