Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kampersanda committed Sep 17, 2023
1 parent 6def4d2 commit 2451f87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ impl<T> Sparse<T> {
continue 'a;
}
}
// If edges allow all label values from x00 to xFF, such unreachable instances can be
// created. However, this would not happen in trie-match because only string literals
// are allowed, and xFF will never appear.
// (See hogehoge)
unreachable!("No unused base found");
}
(bases, checks, values)
Expand Down
5 changes: 5 additions & 0 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ fn test_try_base_conflict() {
// This test confirms that check[0] does not have an invalid value of zero.
#[test]
fn test_invalid_root_check() {
// [0] -x01-> [1]
// \-x00-> [0] ? If check[0] is 0, such an invalid transition is possible.
//
// base: [0, MAX]
// check: [0, 1]
let f = |text| {
trie_match! {
match text {
Expand Down

0 comments on commit 2451f87

Please sign in to comment.