From ab8666f7ef57bd1948917a6d111c599df6fc5fa2 Mon Sep 17 00:00:00 2001 From: Mingun Date: Thu, 28 Mar 2024 20:41:32 +0500 Subject: [PATCH] Nim: do not wrap ternary operators in parenthesis when not needed --- .../main/scala/io/kaitai/struct/translators/NimTranslator.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/src/main/scala/io/kaitai/struct/translators/NimTranslator.scala b/shared/src/main/scala/io/kaitai/struct/translators/NimTranslator.scala index f82e00eb7..328315502 100644 --- a/shared/src/main/scala/io/kaitai/struct/translators/NimTranslator.scala +++ b/shared/src/main/scala/io/kaitai/struct/translators/NimTranslator.scala @@ -38,7 +38,7 @@ class NimTranslator(provider: TypeProvider, importList: ImportList) extends Base case _ => s"this.${doName(s)}" } override def doIfExp(condition: expr, ifTrue: expr, ifFalse: expr): String = - s"(if ${translate(condition)}: ${translate(ifTrue)} else: ${translate(ifFalse)})" + s"if ${translate(condition)}: ${translate(ifTrue)} else: ${translate(ifFalse)}" override def arraySubscript(container: expr, idx: expr): String = s"${translate(container)}[${translate(idx)}]"