mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-10-20 09:23:41 +00:00
add label and comment show
This commit is contained in:
parent
8ac49b7f10
commit
973172f90e
@ -6,4 +6,14 @@ trait BitField[A] {
|
||||
def comment: String
|
||||
|
||||
def labels: NonEmptyList[String]
|
||||
|
||||
/**
|
||||
* ASM-safe label
|
||||
*/
|
||||
def label(x: A): String
|
||||
|
||||
/**
|
||||
* Comment string
|
||||
*/
|
||||
def comment(x: A): String
|
||||
}
|
||||
|
@ -6,4 +6,14 @@ trait EnumAsm[A] {
|
||||
def comment: String
|
||||
|
||||
def labels: NonEmptyList[String]
|
||||
|
||||
/**
|
||||
* ASM-safe label
|
||||
*/
|
||||
def label(x: A): String
|
||||
|
||||
/**
|
||||
* Comment string
|
||||
*/
|
||||
def comment(x: A): String
|
||||
}
|
||||
|
@ -117,6 +117,12 @@ object Foo {
|
||||
|
||||
def labels: NonEmptyList[String] =
|
||||
NonEmptyList.of("courage", "wisdom", "power")
|
||||
|
||||
def label(x: Foo): String =
|
||||
"fooNotEnum"
|
||||
|
||||
def comment(x: Foo): String =
|
||||
"Foo not an enum"
|
||||
}
|
||||
|
||||
implicit val bitFieldFoo: BitField[Foo] =
|
||||
@ -127,5 +133,10 @@ object Foo {
|
||||
def labels: NonEmptyList[String] =
|
||||
NonEmptyList.of("up", "down", "left", "right")
|
||||
|
||||
def label(x: Foo): String =
|
||||
"fooNotBitField"
|
||||
|
||||
def comment(x: Foo): String =
|
||||
"Foo not a bit field"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user