diff options
Diffstat (limited to 'lib/xixanta/src/mapping.rs')
| -rw-r--r-- | lib/xixanta/src/mapping.rs | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/xixanta/src/mapping.rs b/lib/xixanta/src/mapping.rs index 231883f..9d313a5 100644 --- a/lib/xixanta/src/mapping.rs +++ b/lib/xixanta/src/mapping.rs @@ -1,9 +1,3 @@ -use crate::instruction::{Fill, Node, PString}; -use std::collections::HashMap; - -use crate::errors::ParseError; -type Result<T> = std::result::Result<T, ParseError>; - lazy_static! { pub static ref EMPTY: Vec<Segment> = vec![Segment { name: String::from("CODE"), @@ -16,25 +10,25 @@ lazy_static! { name: String::from("HEADER"), start: 0x0000, size: 0x0010, - fill: Some(Fill { value: 0x00 }), + fill: Some(0x00), }, Segment { name: String::from("VECTORS"), start: 0xFFFA, size: 0x0006, - fill: Some(Fill { value: 0x00 }), + fill: Some(0x00), }, Segment { name: String::from("CODE"), start: 0x8000, size: 0x7FFA, - fill: Some(Fill { value: 0x00 }), + fill: Some(0x00), }, Segment { name: String::from("CHARS"), start: 0x0000, size: 0x2000, - fill: Some(Fill { value: 0x00 }), + fill: Some(0x00), } ]; } @@ -44,9 +38,10 @@ pub struct Segment { pub name: String, pub start: u16, pub size: usize, - pub fill: Option<Fill>, + pub fill: Option<usize>, } +/* TODO #[derive(Debug)] pub struct Mapping { pub segments: Vec<Segment>, @@ -90,9 +85,10 @@ impl Mapping { pub fn switch(&mut self, id: &PString) -> Result<()> { if !self.nodes.contains_key(&id.value) { - return Err( - id.parser_error(format!("segment '{}' has not been defined", id.value).as_str()) - ); + // TODO + // return Err( + // id.parser_error(format!("segment '{}' has not been defined", id.value).as_str()) + // ); } id.value.clone_into(&mut self.current); @@ -114,3 +110,4 @@ impl Mapping { } } } +*/ |
