From 1f18a960a5826ce38e2f758b9160df260d120cfc Mon Sep 17 00:00:00 2001 From: iximeow Date: Mon, 17 Jun 2024 01:44:12 -0700 Subject: add token spans for some registers --- src/long_mode/display.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index b67acd4..0d11e33 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -450,13 +450,20 @@ impl crate::long_mode::OperandVisitor for Coloriz Ok(()) } fn visit_reg(&mut self, reg: RegSpec) -> Result { - self.f.write_str(regspec_label(®)) + self.f.span_enter(TokenType::Register); + self.f.write_str(regspec_label(®))?; + self.f.span_end(TokenType::Register); + Ok(()) } fn visit_reg_mask_merge(&mut self, spec: RegSpec, mask: RegSpec, merge_mode: MergeMode) -> Result { + self.f.span_enter(TokenType::Register); self.f.write_str(regspec_label(&spec))?; + self.f.span_end(TokenType::Register); if mask.num != 0 { self.f.write_str("{")?; + self.f.span_enter(TokenType::Register); self.f.write_str(regspec_label(&mask))?; + self.f.span_end(TokenType::Register); self.f.write_str("}")?; } if let MergeMode::Zero = merge_mode { -- cgit v1.1