From c20b6f833c50bb9e36267de2dec9e0b549f31d1a Mon Sep 17 00:00:00 2001 From: Mark Canlas Date: Wed, 26 Aug 2020 03:02:10 -0400 Subject: [PATCH] rename definable to named resource --- .../scala/com/htmlism/mos6502/dsl/AsmDocumentContext.scala | 6 +++--- .../mos6502/dsl/{Definable.scala => NamedResource.scala} | 2 +- .../scala/com/htmlism/mos6502/dsl/ReadWriteLocation.scala | 4 ++-- src/main/scala/com/htmlism/mos6502/dsl/VolatileDevice.scala | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename src/main/scala/com/htmlism/mos6502/dsl/{Definable.scala => NamedResource.scala} (89%) diff --git a/src/main/scala/com/htmlism/mos6502/dsl/AsmDocumentContext.scala b/src/main/scala/com/htmlism/mos6502/dsl/AsmDocumentContext.scala index 95f4cdd..b4c5276 100644 --- a/src/main/scala/com/htmlism/mos6502/dsl/AsmDocumentContext.scala +++ b/src/main/scala/com/htmlism/mos6502/dsl/AsmDocumentContext.scala @@ -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) } diff --git a/src/main/scala/com/htmlism/mos6502/dsl/Definable.scala b/src/main/scala/com/htmlism/mos6502/dsl/NamedResource.scala similarity index 89% rename from src/main/scala/com/htmlism/mos6502/dsl/Definable.scala rename to src/main/scala/com/htmlism/mos6502/dsl/NamedResource.scala index 0a16ff0..d1cb047 100644 --- a/src/main/scala/com/htmlism/mos6502/dsl/Definable.scala +++ b/src/main/scala/com/htmlism/mos6502/dsl/NamedResource.scala @@ -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 diff --git a/src/main/scala/com/htmlism/mos6502/dsl/ReadWriteLocation.scala b/src/main/scala/com/htmlism/mos6502/dsl/ReadWriteLocation.scala index 4464f88..caa08e8 100644 --- a/src/main/scala/com/htmlism/mos6502/dsl/ReadWriteLocation.scala +++ b/src/main/scala/com/htmlism/mos6502/dsl/ReadWriteLocation.scala @@ -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") diff --git a/src/main/scala/com/htmlism/mos6502/dsl/VolatileDevice.scala b/src/main/scala/com/htmlism/mos6502/dsl/VolatileDevice.scala index c810604..a981228 100644 --- a/src/main/scala/com/htmlism/mos6502/dsl/VolatileDevice.scala +++ b/src/main/scala/com/htmlism/mos6502/dsl/VolatileDevice.scala @@ -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")