fixed labels, added comments
This commit is contained in:
parent
2a08362b52
commit
82160af7af
|
@ -14,6 +14,7 @@ macro_rules! tokendef {
|
|||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Logos)]
|
||||
#[logos(extras = Rodeo)]
|
||||
#[logos(skip r"[ \t\f]+")]
|
||||
#[logos(skip r"-- .*")]
|
||||
pub enum Token {
|
||||
$(#[token($opcode, |_| hbbytecode::opcode::[<$opcode:upper>])])*
|
||||
OpCode(u8),
|
||||
|
@ -130,6 +131,7 @@ pub fn assembly(code: &str, buf: &mut Vec<u8>) -> Result<(), Error> {
|
|||
Some(Ok(Token::Label(lbl))) => {
|
||||
self.lblmap.insert(lbl, self.buf.len() as u64 + 1);
|
||||
}
|
||||
Some(Ok(Token::ISep)) => (),
|
||||
Some(Ok(_)) => return Err(ErrorKind::UnexpectedToken),
|
||||
Some(Err(())) => return Err(ErrorKind::InvalidToken),
|
||||
None => return Ok(()),
|
||||
|
|
Loading…
Reference in a new issue