clarify definition group comments

This commit is contained in:
Mark Canlas 2020-08-26 01:35:37 -04:00
parent 0902288b15
commit 90019b6663
7 changed files with 12 additions and 10 deletions

View File

@ -3,7 +3,7 @@ package com.htmlism.mos6502.dsl
import cats.data.NonEmptyList
trait BitField[A] {
def comment: String
def definitionGroupComment: String
/**
* An ordered list of every status in this bit field

View File

@ -6,7 +6,7 @@ import cats.data.NonEmptyList
* Like an enum, but values are specified
*/
trait Mapping[A] {
def comment: String
def definitionGroupComment: String
/**
* An ordered list of every value in this enumeration

View File

@ -58,7 +58,7 @@ trait AsmDocSyntax {
val grp =
DefinitionGroup(
ev.comment,
ev.definitionGroupComment,
xs
.map {
case (s, n) =>
@ -78,7 +78,7 @@ trait AsmDocSyntax {
val grp =
DefinitionGroup(
ev.comment,
ev.definitionGroupComment,
xs
.map {
case (s, n) =>

View File

@ -180,7 +180,7 @@ case object Right extends TestDirection
object TestDirection {
implicit val bitFieldDirection: BitField[TestDirection] =
new BitField[TestDirection] {
def comment: String =
def definitionGroupComment: String =
"foo as bit field"
def all: NonEmptyList[TestDirection] =
@ -195,7 +195,7 @@ object TestDirection {
implicit val mappingDirection: Mapping[TestDirection] =
new Mapping[TestDirection] {
def comment: String =
def definitionGroupComment: String =
"foo as a mapping"
def all: NonEmptyList[TestDirection] =

View File

@ -6,8 +6,8 @@ import cats.data.NonEmptyList
object AsciiValue {
implicit val asciiValueMapping: Mapping[AsciiValue] =
new Mapping[AsciiValue] {
def comment: String =
"foo as a mapping"
def definitionGroupComment: String =
"ASCII values of keys controlling the snake"
def all: NonEmptyList[AsciiValue] =
NonEmptyList.of(AsciiW, AsciiA, AsciiS, AsciiD)

View File

@ -6,8 +6,8 @@ import cats.data.NonEmptyList
object Direction {
implicit val directionBitField: BitField[Direction] =
new BitField[Direction] {
def comment: String =
"foo as bit field"
def definitionGroupComment: String =
"Directions"
def all: NonEmptyList[Direction] =
NonEmptyList.of(Up, Down, Left, Right)

View File

@ -77,6 +77,8 @@ class Easy6502Spec extends AnyFlatSpec with should.Matchers {
val initSnake =
sub("initSnake") { implicit a =>
snakeDirection.write(Right)
snakeLength.read
}
val generateApplePosition =