//! This module contains anything within the first stage of assembly, i.e. the //! tokenisation stage, or utility functions for reading input files. use std::{ io::{BufRead, Lines}, path::Path, }; use crate::error::AssembleError; pub mod lines; pub mod source_info; pub mod token; pub mod token_info; pub mod tokeniser; /// Attempts to load and open a source file, returning a [`Vec`] or an /// [`AssembleError`]. pub fn load_source_bytes>(p: P) -> Result, AssembleError> { let path = p.as_ref(); Ok(std::fs::read(path)?) } /// Get the lines from a [`BufReader`]. pub fn reader_lines(rdr: R) -> Lines { rdr.lines() }