tamer: obj::xmle::xir: Finalize docs

This could be improved upon, but there will be more work coming up for this
to finalize Sections.

DEV-10561
main
Mike Gerwitz 2021-10-11 11:43:49 -04:00
parent bc5e8ebe75
commit 3e385d1a1b
2 changed files with 16 additions and 2 deletions

View File

@ -237,7 +237,6 @@ fn output_xmle<'a>(
let file = fs::File::create(output)?;
let mut buf = BufWriter::new(file);
// TODO: check writer final state to make sure it actually finished
lower_iter(&sorted, name, relroot.intern())
.write(&mut buf, Default::default())?;

View File

@ -17,7 +17,17 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//! WIP lowering to XIR-based `xmle`.
//! Lower [`Sections`] into a XIR [`Token`] stream for `xmle` output.
//!
//! This is the final step in the linker,
//! producing the `xmle` file that can be used to produce the standalone
//! `js` file
//! (which is still part of the XSLT-based system at the time of
//! writing).
//!
//! Use [`lower_iter`] to produce the lowering iterator,
//! which can then use [`XmleWriter`](crate::ir::xir::writer::XmleWriter)
//! for writing.
use crate::{
ir::{
@ -373,6 +383,11 @@ impl<'a, T: IdentObjectData> Iterator for LowerIter<'a, T> {
}
}
/// Lower [`Sections`] into a XIR [`Token`] stream for writing.
///
/// This produces the final representation for the `xmle` file,
/// which can be written using
/// [`XmleWriter`](crate::ir::xir::writer::XmleWriter).
#[inline]
pub fn lower_iter<'a, T: IdentObjectData>(
sections: &'a Sections<T>,