Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/lib.rs')
-rw-r--r--crates/parser/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs
index f20d32d6cf..6c72b5994b 100644
--- a/crates/parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
@@ -102,10 +102,12 @@ impl TopEntryPoint {
match step {
Step::Enter { .. } => depth += 1,
Step::Exit => depth -= 1,
- Step::FloatSplit { .. } | Step::Token { .. } | Step::Error { .. } => (),
+ Step::FloatSplit { .. } => depth -= 1,
+ Step::Token { .. } | Step::Error { .. } => (),
}
}
assert!(!first, "no tree at all");
+ assert_eq!(depth, 0, "unbalanced tree");
}
res