aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/validation.rs
diff options
context:
space:
mode:
authorVille Penttinen <[email protected]>2019-02-17 17:08:34 +0000
committerVille Penttinen <[email protected]>2019-02-17 17:26:57 +0000
commit1c97c1ac11459d45f7bfc57dc72428d2b294520c (patch)
tree70638cabf61f96a7511f974cc66dae40175bfb22 /crates/ra_syntax/src/validation.rs
parent982f72c022b45629e6adbaef22884359d3495ecf (diff)
Enable parsing of attributes inside a match block
We allow invalid inner attributes to be parsed, e.g. inner attributes that are not directly after the opening brace of the match block. Instead we run validation on `MatchArmList` to allow better reporting of errors.
Diffstat (limited to 'crates/ra_syntax/src/validation.rs')
-rw-r--r--crates/ra_syntax/src/validation.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs
index 10672d6bf..27a465a78 100644
--- a/crates/ra_syntax/src/validation.rs
+++ b/crates/ra_syntax/src/validation.rs
@@ -3,6 +3,7 @@ mod byte_string;
3mod char; 3mod char;
4mod string; 4mod string;
5mod block; 5mod block;
6mod match_armlist;
6 7
7use crate::{ 8use crate::{
8 SourceFile, syntax_node::SyntaxError, AstNode, 9 SourceFile, syntax_node::SyntaxError, AstNode,
@@ -19,6 +20,7 @@ pub(crate) fn validate(file: &SourceFile) -> Vec<SyntaxError> {
19 .visit::<ast::Char, _>(self::char::validate_char_node) 20 .visit::<ast::Char, _>(self::char::validate_char_node)
20 .visit::<ast::String, _>(self::string::validate_string_node) 21 .visit::<ast::String, _>(self::string::validate_string_node)
21 .visit::<ast::Block, _>(self::block::validate_block_node) 22 .visit::<ast::Block, _>(self::block::validate_block_node)
23 .visit::<ast::MatchArmList, _>(self::match_armlist::validate_match_armlist)
22 .accept(node); 24 .accept(node);
23 } 25 }
24 errors 26 errors