piccolo
piccolo copied to clipboard
`Feature`: implemented `string.format`
Features
- Fully supports all specifiers described in Lua 5.4 manual.
- Compared to the previous PR,
%phas been implemented and support has been added for types that can be converted toStringusing__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.