diff options
Diffstat (limited to 'crates/ra_syntax/src/validation.rs')
-rw-r--r-- | crates/ra_syntax/src/validation.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs index 11a1fb4a7..b53900a4b 100644 --- a/crates/ra_syntax/src/validation.rs +++ b/crates/ra_syntax/src/validation.rs | |||
@@ -5,9 +5,10 @@ mod field_expr; | |||
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | SourceFile, SyntaxError, AstNode, SyntaxNode, TextUnit, | 7 | SourceFile, SyntaxError, AstNode, SyntaxNode, TextUnit, |
8 | SyntaxKind::{L_CURLY, R_CURLY, BYTE, BYTE_STRING, STRING, CHAR}, | 8 | SyntaxKind::{BYTE, BYTE_STRING, STRING, CHAR}, |
9 | ast, | 9 | ast, |
10 | algo::visit::{visitor_ctx, VisitorCtx}, | 10 | algo::visit::{visitor_ctx, VisitorCtx}, |
11 | T, | ||
11 | }; | 12 | }; |
12 | 13 | ||
13 | pub(crate) use unescape::EscapeError; | 14 | pub(crate) use unescape::EscapeError; |
@@ -83,8 +84,8 @@ pub(crate) fn validate_block_structure(root: &SyntaxNode) { | |||
83 | let mut stack = Vec::new(); | 84 | let mut stack = Vec::new(); |
84 | for node in root.descendants() { | 85 | for node in root.descendants() { |
85 | match node.kind() { | 86 | match node.kind() { |
86 | L_CURLY => stack.push(node), | 87 | T!['{'] => stack.push(node), |
87 | R_CURLY => { | 88 | T!['}'] => { |
88 | if let Some(pair) = stack.pop() { | 89 | if let Some(pair) = stack.pop() { |
89 | assert_eq!( | 90 | assert_eq!( |
90 | node.parent(), | 91 | node.parent(), |