ra_syntax: added tests for tokenization errors

This commit is contained in:
Veetaha 2020-02-01 22:25:01 +02:00
parent 9367b9a292
commit a3e5663ae0
150 changed files with 427 additions and 49 deletions

View file

@ -94,6 +94,12 @@ impl From<rustc_lexer::unescape::EscapeError> for SyntaxErrorKind {
}
pub(crate) fn validate(root: &SyntaxNode) -> Vec<SyntaxError> {
// FIXME:
// * Add validation of character literal containing only a single char
// * Add validation of `crate` keyword not appearing in the middle of the symbol path
// * Add validation of doc comments are being attached to nodes
// * Remove validation of unterminated literals (it is already implemented in `tokenize()`)
let mut errors = Vec::new();
for node in root.descendants() {
match_ast! {