misc fixes

This commit is contained in:
DropDemBits 2024-09-02 22:53:54 -04:00
parent d929121f7b
commit 69e8393963
No known key found for this signature in database
GPG key ID: 7FE02A6C1EDFA075
3 changed files with 20 additions and 26 deletions

View file

@ -1,3 +1,7 @@
//! Maps syntax elements through disjoint syntax nodes.
//!
//! [`SyntaxMappingBuilder`] should be used to create mappings to add to a [`SyntaxEditor`]
use itertools::Itertools;
use rustc_hash::FxHashMap;
@ -168,11 +172,11 @@ impl SyntaxMapping {
match (input_mapping, input_ancestor) {
(Some(input_mapping), _) => {
// A mapping exists at the input, follow along the tree
Some(self.upmap_child(&input_mapping, &input_mapping, &output_root))
Some(self.upmap_child(&input_mapping, &input_mapping, output_root))
}
(None, Some(input_ancestor)) => {
// A mapping exists at an ancestor, follow along the tree
Some(self.upmap_child(input, &input_ancestor, &output_root))
Some(self.upmap_child(input, &input_ancestor, output_root))
}
(None, None) => {
// No mapping exists at all, is the same position in the final tree