Blank lines and line addressing
This commit is contained in:
@@ -502,4 +502,18 @@ mod test {
|
|||||||
])
|
])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_relative_blanks() {
|
||||||
|
assert_eq!(assemble_snippet(".org 0x400
|
||||||
|
nop $+2
|
||||||
|
|
||||||
|
nop 0x111111
|
||||||
|
nop 0x222222".lines()),
|
||||||
|
Ok(vec![
|
||||||
|
0x03, 0x08, 0x04, 0x00,
|
||||||
|
0x03, 0x11, 0x11, 0x11,
|
||||||
|
0x03, 0x22, 0x22, 0x22
|
||||||
|
]))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,12 @@ impl<'a, T: IntoIterator<Item = &'a str>, F: Fn(String) -> Result<T, AssembleErr
|
|||||||
self.next()
|
self.next()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: This makes line numbers on error messages wrong, but it's hard to fix. We need
|
||||||
|
// to rip out and redo the whole error system. Parse lines initially to tuples of their
|
||||||
|
// line and location (file and line number) and then pass one of those tuples to create
|
||||||
|
// an error.
|
||||||
|
Ok(VASMLine::Blank) => { self.next() }
|
||||||
|
|
||||||
Ok(normal_line) => Some(Ok(Line {
|
Ok(normal_line) => Some(Ok(Line {
|
||||||
line: normal_line,
|
line: normal_line,
|
||||||
line_num: self.current_line,
|
line_num: self.current_line,
|
||||||
|
|||||||
Reference in New Issue
Block a user