From 7b8f372648c963ede74e142da1d5ff86757aa8a6 Mon Sep 17 00:00:00 2001 From: Mikhail Yakshin Date: Sat, 2 Mar 2024 13:52:51 +0000 Subject: [PATCH] LuaTranslator: fix string concat for doInterpolatedStringLiteral --- .../scala/io/kaitai/struct/translators/LuaTranslator.scala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared/src/main/scala/io/kaitai/struct/translators/LuaTranslator.scala b/shared/src/main/scala/io/kaitai/struct/translators/LuaTranslator.scala index c1da7d155..b3287d4e9 100644 --- a/shared/src/main/scala/io/kaitai/struct/translators/LuaTranslator.scala +++ b/shared/src/main/scala/io/kaitai/struct/translators/LuaTranslator.scala @@ -160,6 +160,13 @@ class LuaTranslator(provider: TypeProvider, importList: ImportList) extends Base s"utils.array_max(${translate(a)})" } + override def doInterpolatedStringLiteral(exprs: Seq[Ast.expr]): String = + if (exprs.isEmpty) { + doStringLiteral("") + } else { + exprs.map(anyToStr).mkString(" .. ") + } + override def kaitaiStreamSize(value: Ast.expr): String = s"${translate(value)}:size()" override def kaitaiStreamEof(value: Ast.expr): String =