Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Folia

A minimal framework for narrative games. · By Axile

[bug] loose parens make their way into interpolated strings

A topic by ironlantern72 created 56 days ago Views: 69 Replies: 3
Viewing posts 1 to 3
(2 edits)

steps to reproduce

  • inside a node, use an interpolated string involving an inline function call (e.g. magical orbs: $(table.concat(prog.orbs, ", "))), by giving it to status(), text(), line(), say(), etc
  • run the node

expected result

string interpolates to call result without unexpected characters (magical orbs: fire, water)

actual result

string interpolates to call result plus a stray closing paren (magical orbs: fire, water))

additional info

  • engine version: 1.3.0
  • platform: linux (WINE)
Developer

Thanks for this, taking a look.

This one I'm not able to reproduce exactly. ref. the other bug, "string interpolation" in Folia is very basic and only supports substituting named variables, so the whole sequence between the brackets here is interpreted as an identifier, which isn't valid, so evaluates to nil (with a stray end bracket at the end, tbf, but either way you wouldn't see the behaviour you expect). We could probably do with some better error reporting here.

alright, i see. so it grabs the first closing paren it sees as the end of substitution, and the second is outside the substitution entirely. i suppose the report is invalid then