summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorBen Bridle <bridle.benjamin@gmail.com>2024-10-30 14:48:10 +1300
committerBen Bridle <bridle.benjamin@gmail.com>2024-10-30 15:40:25 +1300
commit6cc0bec0e11d5fec757e90aebd7e51ed9393365c (patch)
tree9561c5a940db2389163ce62ba419c7821bc693a6 /src/lib.rs
parent2cd0c86659479774d092de727e0f0c31e27e49f2 (diff)
downloadbedrock-asm-6cc0bec0e11d5fec757e90aebd7e51ed9393365c.zip
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.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs1
1 files changed, 1 insertions, 0 deletions
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)]