Skip to content

Commit

Permalink
LuaTranslator: fix string concat for doInterpolatedStringLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyCat committed Mar 2, 2024
1 parent b47078c commit 7b8f372
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 7b8f372

Please sign in to comment.