Skip to content

Commit

Permalink
Fix alternation formatting in RiddlFileEmitter
Browse files Browse the repository at this point in the history
Signed-off-by: reidspencer <reid.spencer@yoppworks.com>
  • Loading branch information
reid-spencer committed Sep 28, 2023
1 parent f1422cf commit 8e311c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ case class RiddlFileEmitter(filePath: Path) extends TextFileWriter {

def emitAlternation(alternation: Alternation): this.type = {
add(s"one of {\n").indent.addIndent("")
alternation.of.map(emitTypeExpression).mkString("", " or ", "\n")
val paths: Seq[String] = alternation.of.map { (typeEx: AliasedTypeExpression) => typeEx.pathId.format }
add(paths.mkString("", " or ", "\n"))
outdent.addIndent("}")
this
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class PrettifyTest extends RiddlFilesTestBase {

"check mappings" in { processADirectory("testkit/src/test/input/mappings") }
"check ranges" in { processADirectory("testkit/src/test/input/ranges") }
"check everything.riddl" in {
"check everything.riddl" in {
processAFile("testkit/src/test/input/everything.riddl")
}
"check petstore.riddl" in {
Expand Down

0 comments on commit 8e311c6

Please sign in to comment.