diff options
author | iximeow <me@iximeow.net> | 2024-06-17 01:44:12 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2024-06-17 01:55:43 -0700 |
commit | 1f18a960a5826ce38e2f758b9160df260d120cfc (patch) | |
tree | 089cfbda7d6a0fde22aad119ced6523c2cedb005 | |
parent | 0399548ac215717e23d2ad76cb1417892b477c74 (diff) |
add token spans for some registers
-rw-r--r-- | src/long_mode/display.rs | 9 |
1 files changed, 8 insertions, 1 deletions
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 <T: DisplaySink, Y: YaxColors> crate::long_mode::OperandVisitor for Coloriz Ok(()) } fn visit_reg(&mut self, reg: RegSpec) -> Result<Self::Ok, Self::Error> { - 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::Ok, Self::Error> { + 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 { |