Skip to content

Commit

Permalink
refactor: move file to unordered mod for later improvements in design
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh committed May 1, 2024
1 parent 082b46e commit eb9fe81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions matching/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod assignment_problem;
mod unordered;
mod matching;
mod matching_entry;
mod matchings;
Expand All @@ -25,7 +25,7 @@ pub fn calculate_matchings<'a>(
) => {
if non_terminal_left.are_children_unordered && non_terminal_right.are_children_unordered
{
assignment_problem::unordered_tree_matching(left, right, matching_handlers)
unordered::assignment_problem::calculate_matchings(left, right, matching_handlers)
} else {
ordered_tree_matching::ordered_tree_matching(left, right, matching_handlers)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use model::{cst_node::NonTerminal, CSTNode};
use pathfinding::{kuhn_munkres::Weights, matrix};
use unordered_pair::UnorderedPair;

use crate::{calculate_matchings, MatchingEntry, Matchings};
use crate::{MatchingEntry, Matchings};

pub fn unordered_tree_matching<'a>(
pub fn calculate_matchings<'a>(
left: &'a CSTNode,
right: &'a CSTNode,
matching_handlers: &'a MatchingHandlers<'a>,
Expand Down Expand Up @@ -35,7 +35,7 @@ pub fn unordered_tree_matching<'a>(
children_right
.iter()
.map(|right_child| {
let w = calculate_matchings(left_child, right_child, matching_handlers);
let w = crate::calculate_matchings(left_child, right_child, matching_handlers);
let matching = w
.get_matching_entry(left_child, right_child)
.unwrap_or_default();
Expand Down
1 change: 1 addition & 0 deletions matching/src/unordered/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod assignment_problem;

0 comments on commit eb9fe81

Please sign in to comment.