From 6cc0bec0e11d5fec757e90aebd7e51ed9393365c Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Wed, 30 Oct 2024 14:48:10 +1300 Subject: Implement an intelligent source merging strategy The previous source merging strategy was to concatenate source units in the reverse order that they were added to the resolver, which generally only worked when each source unit had at most one macro-resolving parent. An issue arose when some macros in a source unit were resolved by a source unit which had been added earlier in the order, as the required macro definitions would then be merged after they were referenced, preventing the program from assembling. The new source merging strategy finds an optimal merge order by first recording for a given source unit the ID of each unit which resolves a macro referenced by the given unit, and then only merging those source units whose macro-defining dependencies have already been merged. In the case that a cycle is detected, where two or more source units depend on one another, a message is printed and the assembly is aborted. --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index ff00605..3470e6e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +#![feature(extract_if)] #![feature(io_error_more)] #![feature(map_try_insert)] -- cgit v1.2.3-70-g09d2