piccolo icon indicating copy to clipboard operation
piccolo copied to clipboard

`Feature`: implemented `string.format`

Open reloginn opened this issue 4 months ago • 0 comments

Features

  • Fully supports all specifiers described in Lua 5.4 manual.
  • Compared to the previous PR, %p has been implemented and support has been added for types that can be converted to String using __tostring.

Note

The implementation was based on the sprintf, but according to the Lua 5.4 manual:

The format string follows the same rules as the ISO C function sprintf. The only differences are that the conversion specifiers ?> and modifiers F, n, *, h, L, and l are not supported and that there is an extra specifier, q.

so I just removed the unsupported specifiers and added q.

reloginn avatar Aug 10 '25 18:08 reloginn