summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-01-18 14:31:58 -0800
committeriximeow <me@iximeow.net>2020-01-18 14:31:58 -0800
commit9e46e4718e6c31b4f9ae35ff4a0e65d206b8e688 (patch)
tree4bca466641e7883d660a0e9a72467d9d099a6385
parent8713eca470b00a7afc2d3d18b3fbe13c77806bc0 (diff)
make NoContext public, move to yaxpeax-arch crate
-rw-r--r--Cargo.toml2
-rw-r--r--src/display.rs6
-rw-r--r--src/lib.rs1
3 files changed, 5 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index e65cce0..811bcad 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,7 +8,7 @@ repository = "http://git.iximeow.net/yaxpeax-msp430/"
description = "msp430 decoders for the yaxpeax project"
[dependencies]
-yaxpeax-arch = { path = "../../yaxpeax-arch" }
+yaxpeax-arch = { version = "0.0.2", default-features = false, features = [] }
"termion" = "1.4.0"
"serde" = "*"
"serde_derive" = "*"
diff --git a/src/display.rs b/src/display.rs
index f523e65..d9b8f10 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -2,7 +2,7 @@ use ::{MSP430, Operand, Opcode, Instruction, Width, DecodeError};
use std::fmt::{self, Display, Formatter};
use std;
-use yaxpeax_arch::{Arch, Colorize, ColorSettings, NoColors, ShowContextual, YaxColors};
+use yaxpeax_arch::{Arch, Colorize, NoColors, ShowContextual, YaxColors};
impl Display for Instruction {
fn fmt(&self, f: &mut Formatter) -> Result<(), std::fmt::Error> {
@@ -23,7 +23,7 @@ impl fmt::Display for DecodeError {
}
/// No per-operand when contextualizing an instruction.
-struct NoContext;
+pub struct NoContext;
impl <T: std::fmt::Write, Color: fmt::Display, Y: YaxColors<Color>> ShowContextual<<MSP430 as Arch>::Address, NoContext, Color, T, Y> for Instruction {
fn contextualize(&self, _colors: &Y, _address: <MSP430 as Arch>::Address, _context: Option<&NoContext>, out: &mut T) -> std::fmt::Result {
@@ -50,7 +50,7 @@ impl <T: std::fmt::Write, Color: fmt::Display, Y: YaxColors<Color>> ShowContextu
#[cfg(feature="std")]
impl <T: std::fmt::Write, Color: fmt::Display, Y: YaxColors<Color>> ShowContextual<<MSP430 as Arch>::Address, [Option<String>], Color, T, Y> for Instruction {
- fn contextualize(&self, _colors: Option<&ColorSettings>, _address: <MSP430 as Arch>::Address, _context: Option<&[Option<String>]>, out: &mut T) -> std::fmt::Result {
+ fn contextualize(&self, _colors: &Y, _address: <MSP430 as Arch>::Address, _context: Option<&[Option<String>]>, out: &mut T) -> std::fmt::Result {
write!(out, "{}", self.opcode)?;
match self.op_width {
Width::B => { write!(out, ".b")? },
diff --git a/src/lib.rs b/src/lib.rs
index 74f814c..ccaf2ec 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,6 +11,7 @@ extern crate termion;
use yaxpeax_arch::{Arch, Decoder, LengthedInstruction};
mod display;
+pub use display::NoContext;
#[cfg(feature="use-serde")]
#[derive(Debug, Serialize, Deserialize)]