This commit is contained in:
Mark Canlas 2022-12-04 16:49:05 -05:00
parent b4733e54da
commit 67c77196f1
2 changed files with 16 additions and 12 deletions

View File

@ -0,0 +1,16 @@
package com.htmlism.firepower.demo.asm
import com.htmlism.firepower.demo.str.Paragraph
sealed trait AsmBlock
case class CommentBlock(xs: List[String]) extends AsmBlock
object CommentBlock:
def toParagraph(xs: AsmBlock): Paragraph =
xs match
case CommentBlock(ys) =>
Paragraph(ys.map("; " + _))
def fromMultiline(s: String): CommentBlock =
CommentBlock(s.split("\\n").toList)

View File

@ -1,12 +0,0 @@
package com.htmlism.firepower.demo.asm
import com.htmlism.firepower.demo.str.Paragraph
case class CommentBlock(xs: List[String])
object CommentBlock:
def toParagraph(cb: CommentBlock): Paragraph =
Paragraph(cb.xs.map("; " + _))
def fromMultiline(s: String): CommentBlock =
CommentBlock(s.split("\\n").toList)