apply T! macro where it is possible

This commit is contained in:
Sergey Parilin 2019-05-15 15:35:47 +03:00
parent d77175ce28
commit 993abedd77
38 changed files with 619 additions and 623 deletions

View file

@ -5,9 +5,10 @@ mod field_expr;
use crate::{
SourceFile, SyntaxError, AstNode, SyntaxNode, TextUnit,
SyntaxKind::{L_CURLY, R_CURLY, BYTE, BYTE_STRING, STRING, CHAR},
SyntaxKind::{BYTE, BYTE_STRING, STRING, CHAR},
ast,
algo::visit::{visitor_ctx, VisitorCtx},
T,
};
pub(crate) use unescape::EscapeError;
@ -83,8 +84,8 @@ pub(crate) fn validate_block_structure(root: &SyntaxNode) {
let mut stack = Vec::new();
for node in root.descendants() {
match node.kind() {
L_CURLY => stack.push(node),
R_CURLY => {
T!['{'] => stack.push(node),
T!['}'] => {
if let Some(pair) = stack.pop() {
assert_eq!(
node.parent(),