Skip to content

Commit

Permalink
Simlify pattern matches
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Dec 30, 2023
1 parent 8b90c95 commit 5d2a477
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/parse/tree_sitter_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1797,24 +1797,11 @@ mod tests {
let res = parse(&arena, "<style>.a { color: red; }</style>", &config, false);

match res[0] {
Syntax::List {
info: _,
open_position: _,
open_content: _,
children,
close_position: _,
close_content: _,
num_descendants: _,
} => {
Syntax::List { children, .. } => {
// <style>, content, </style>.
assert_eq!(children.len(), 3);
match children[1] {
Syntax::Atom {
info: _,
position: _,
content: _,
kind: _,
} => {
Syntax::Atom { .. } => {
panic!("Style contents is parsed as a single atom");
}
_ => {
Expand Down

0 comments on commit 5d2a477

Please sign in to comment.