mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-11-16 18:05:29 +00:00
rename definable to named resource
This commit is contained in:
parent
cfb6bbbc92
commit
c20b6f833c
@ -74,7 +74,7 @@ class DefinitionGroupContext {
|
||||
private val xs: ListBuffer[Definition[_]] =
|
||||
ListBuffer()
|
||||
|
||||
def push[A](x: A)(implicit ev: Definable[A]): Unit =
|
||||
def push[A](x: A)(implicit ev: NamedResource[A]): Unit =
|
||||
ev
|
||||
.toDefinitions(x)
|
||||
.foreach(xs.append)
|
||||
@ -93,8 +93,8 @@ case class Definition[A: Operand](name: String, x: A, comment: Option[String]) {
|
||||
}
|
||||
|
||||
object Definition {
|
||||
implicit def definitionDefinable[A]: Definable[Definition[A]] =
|
||||
new Definable[Definition[A]] {
|
||||
implicit def namedResourceForDefinition[A]: NamedResource[Definition[A]] =
|
||||
new NamedResource[Definition[A]] {
|
||||
def toDefinitions(x: Definition[A]): List[Definition[_]] =
|
||||
List(x)
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.htmlism.mos6502.dsl
|
||||
|
||||
trait Definable[A] {
|
||||
trait NamedResource[A] {
|
||||
|
||||
/**
|
||||
* A `Definable` can emit multiple definitions. Usually in the case of `word`s being split across two byte-definitions
|
@ -20,8 +20,8 @@ case class ReadWriteLocation[A](name: String, address: ZeroAddress) {
|
||||
}
|
||||
|
||||
object ReadWriteLocation {
|
||||
implicit def readWriteLocationDefinable[A]: Definable[ReadWriteLocation[A]] =
|
||||
new Definable[ReadWriteLocation[A]] {
|
||||
implicit def namedResourceForReadWriteLocation[A]: NamedResource[ReadWriteLocation[A]] =
|
||||
new NamedResource[ReadWriteLocation[A]] {
|
||||
def toDefinitions(x: ReadWriteLocation[A]): List[Definition[ZeroAddress]] =
|
||||
List {
|
||||
Definition(x.name, x.address, "Read/write location for A values")
|
||||
|
@ -17,8 +17,8 @@ case class VolatileDevice[A](name: String, address: ZeroAddress) {
|
||||
}
|
||||
|
||||
object VolatileDevice {
|
||||
implicit def volatileDeviceDefinable[A]: Definable[VolatileDevice[A]] =
|
||||
new Definable[VolatileDevice[A]] {
|
||||
implicit def namedResourceForVolatileDevice[A]: NamedResource[VolatileDevice[A]] =
|
||||
new NamedResource[VolatileDevice[A]] {
|
||||
def toDefinitions(x: VolatileDevice[A]): List[Definition[ZeroAddress]] =
|
||||
List {
|
||||
Definition(x.name, x.address, "Volatile generator for A values")
|
||||
|
Loading…
Reference in New Issue
Block a user