From fc925e577dbd8e724fa2d79f4d8a42a7a16ff53f Mon Sep 17 00:00:00 2001 From: jn Date: Wed, 1 Feb 2023 21:19:11 +0100 Subject: [PATCH] Assemble data.8 CONST_LABEL correctly as one byte Fixes #5 --- src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index e439509..4b6b442 100644 --- a/src/main.rs +++ b/src/main.rs @@ -609,21 +609,24 @@ fn parse_data(pair: pest::iterators::Pair) -> AstNode { Rule::data_byte => { match parse_operand(pair.into_inner().next().unwrap(), false) { AstNode::Immediate32(half) => AstNode::DataByte(half as u8), - AstNode::LabelOperand {name, size, is_relative} => AstNode::LabelOperand {name, size, is_relative}, + AstNode::LabelOperand {name, size: _, is_relative} => + AstNode::LabelOperand {name, size: Size::Byte, is_relative}, _ => unreachable!(), } }, Rule::data_half => { match parse_operand(pair.into_inner().next().unwrap(), false) { AstNode::Immediate32(half) => AstNode::DataHalf(half as u16), - AstNode::LabelOperand {name, size, is_relative} => AstNode::LabelOperand {name, size, is_relative}, + AstNode::LabelOperand {name, size: _, is_relative} => + AstNode::LabelOperand {name, size: Size::Half, is_relative}, _ => unreachable!(), } }, Rule::data_word => { match parse_operand(pair.into_inner().next().unwrap(), false) { AstNode::Immediate32(word) => AstNode::DataWord(word), - AstNode::LabelOperand {name, size, is_relative} => AstNode::LabelOperand {name, size, is_relative}, + AstNode::LabelOperand {name, size: _, is_relative} => + AstNode::LabelOperand {name, size: Size::Word, is_relative}, _ => unreachable!(), } },