From a6c2fba0ffe00e2d7a86d9ca7f4dae1611c151dc Mon Sep 17 00:00:00 2001 From: iximeow Date: Wed, 18 Dec 2019 00:29:24 -0800 Subject: color helper for misc instructions --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c8996ee..53807ac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -272,6 +272,7 @@ pub trait YaxColors { fn comparison_op(&self, t: T) -> Colored; fn invalid_op(&self, t: T) -> Colored; fn platform_op(&self, t: T) -> Colored; + fn misc_op(&self, t: T) -> Colored; fn register(&self, t: T) -> Colored; fn program_counter(&self, t: T) -> Colored; @@ -309,6 +310,9 @@ impl YaxColors for ColorSettings { fn invalid_op(&self, t: T) -> Colored { Colored::Color(t, self.invalid) } + fn misc_op(&self, t: T) -> Colored { + Colored::Color(t, self.misc) + } fn platform_op(&self, t: T) -> Colored { Colored::Color(t, self.platform) } @@ -391,6 +395,12 @@ impl <'a> YaxColors for Option<&'a ColorSettings> { None => { Colored::Just(t) } } } + fn misc_op(&self, t: T) -> Colored { + match self { + Some(colors) => { colors.misc_op(t) } + None => { Colored::Just(t) } + } + } fn platform_op(&self, t: T) -> Colored { match self { Some(colors) => { colors.platform_op(t) } -- cgit v1.1