aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/validation.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-31 07:06:31 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-31 07:06:31 +0000
commit97ade899937dafcafa852177c85edb22ce0b80dc (patch)
treecf5f8bdc5647222c8300c3386c5c8d47283d5116 /crates/ra_syntax/src/validation.rs
parent777c79ce6bff0e70c8367f429f058f6d87ff3864 (diff)
parent00e6b5d26c82d5faff066c24418a0eb5741efcd1 (diff)
Merge #692
692: [WIP] Correctly parse attributes r=matklad a=DJMcNab Reference - https://doc.rust-lang.org/reference/attributes.html This fixes/investigates inner attributes for: - [x] `impl` blocks - [x] `extern` blocks - [x] `fn`s (fixes #689) - [x] `mod`s (already supported) - [x] 'block expressions' (the long text just describes all 'blocks' used as statements) This also investigates/fixes outer attributes for: - [ ] 'most statements' (see also: #685, https://doc.rust-lang.org/reference/expressions.html#expression-attributes) - [x] Enum variants, Struct and Union fields (Fixed in #507) - [ ] 'Match expression arms' (@matklad can you provide a test case which explains what this means?) - [ ] 'Generic lifetime or type parameters' - [ ] 'Elements of array expressions, tuple expressions, call expressions, tuple-style struct and enum variant expressions' - [ ] 'The tail expression of block expressions' Co-authored-by: DJMcNab <[email protected]>
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 73e1d20b9..ac6cc3dd6 100644
--- a/crates/ra_syntax/src/validation.rs
+++ b/crates/ra_syntax/src/validation.rs
@@ -2,6 +2,7 @@ mod byte;
2mod byte_string; 2mod byte_string;
3mod char; 3mod char;
4mod string; 4mod string;
5mod block;
5 6
6use crate::{ 7use crate::{
7 SourceFile, yellow::SyntaxError, AstNode, 8 SourceFile, yellow::SyntaxError, AstNode,
@@ -17,6 +18,7 @@ pub(crate) fn validate(file: &SourceFile) -> Vec<SyntaxError> {
17 .visit::<ast::ByteString, _>(self::byte_string::validate_byte_string_node) 18 .visit::<ast::ByteString, _>(self::byte_string::validate_byte_string_node)
18 .visit::<ast::Char, _>(self::char::validate_char_node) 19 .visit::<ast::Char, _>(self::char::validate_char_node)
19 .visit::<ast::String, _>(self::string::validate_string_node) 20 .visit::<ast::String, _>(self::string::validate_string_node)
21 .visit::<ast::Block, _>(self::block::validate_block_node)
20 .accept(node); 22 .accept(node);
21 } 23 }
22 errors 24 errors