8000 Implement `string.format` by Aeledfyr · Pull Request #79 · kyren/piccolo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement string.format #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Implement string.format #79

wants to merge 2 commits into from

Conversation

Aeledfyr
Copy link
Contributor

Implement string.format. This is very messy in its current state and needs work to clean up the sequence part, but it works, and supports calling back to lua tostring metamethods.

- Almost entirely compatible with PRLua under the C locale
- Minor differences in the handling of '%q';
   - Invalid UTF8 is escaped rather than passed through
   - math.mininteger is represented as `(-9223372036854775807-1)`
     rather than `0x8000000000000000` due to parsing differences
     in Piccolo.
- Supports a few extra specifiers:
   - %b and %B for binary integers (C23)
   - %F for uppercase floats
   - %C for encoding a unicode codepoint as utf8
   - %S for utf8-aware strings
@Aeledfyr Aeledfyr marked this pull request as ready for review May 6, 2025 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0