Skip to content
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

Add additional format versions and enhancements. #215

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

Alexhuszagh
Copy link
Owner

This adds newer standard versions for C, C++, C#, and additional programming languages. This also adds support for requiring integer or fraction digits with exponents. This patches support for Rust literals as well as other formats.

@Alexhuszagh Alexhuszagh added enhancement New feature or request format affects the formatting API labels Jan 12, 2025
@Alexhuszagh Alexhuszagh added this to the 1.1 milestone Jan 12, 2025
@Alexhuszagh Alexhuszagh self-assigned this Jan 12, 2025
@Alexhuszagh Alexhuszagh force-pushed the fmt-versions branch 2 times, most recently from 63f9adf to fdef013 Compare January 12, 2025 22:49
@Alexhuszagh
Copy link
Owner Author

This PR also adds a fairly major overhaul for the format API in general, by adding better support for base prefixes and suffixes in a much more comprehensive manner, and also improves a lot of our existing formats and adds newer version compatibility for those formats.

@Alexhuszagh
Copy link
Owner Author

This is turning out to be a massive PR but is currently mostly complete for the enhancements for a much more complete formatting API, better testing, and better examples/pre-built formats.

@Alexhuszagh Alexhuszagh force-pushed the fmt-versions branch 4 times, most recently from f273f28 to 91074ea Compare January 22, 2025 06:37
@Alexhuszagh
Copy link
Owner Author

This PR is making significant progress: a few patches need to be made but all the core schema and logic for testing languages and language versions is in the float format repo.

This patches support for Rust literals as well as other formats.
This adds the following number format flags:
- `supports_parsing_integers`
- `supports_parsing_floats`
- `supports_writing_integers`
- `supports_writing_floats`

If an operation is not supported with the format feature, then the code panics or returns an error immediately, which will always be resolved at compile time.
This requires them when parsing but also adds them to our float and integer writers when writing formats. This is useful for cases like hex floats where the floats only make sense when they have a literal `0x` prefixing them.
This adds in the logic for new digit separator flags defining a number format, as well as enhances our documentation on the specification, however, it does not implement the parsing logic yet. Therefore, the unittests are expected to be broken now.

[skip ci]
This adds support for the integer and exponent digit separator flag parsing.
This keeps our digit counts separate for each component rather than keep them as one of a larger memo, since we can handle eac individual digit separator component correctly like this, and it simplifies and improves performance when one component doesn't allow digit separators.
It's causing massive variability with code changes, without any changes for benches when run independently.
This improves both the parsing of sign and digits for better performance, especially with non-decimal radices and larger digit counts.
This adds comprehensive tests, including correctness ones, as well as performance benchmarks to ensure optimal ASM is generated on x86_64, including re-arranging some code to optimize jumps.
This is a waste of flag space and should be removed prior to any releases.
This enables toggling no unsigned integer negative signs, and having no signs (even negative) for mantissas and exponents. This commit is broken and will not work for the new additions in parsing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request format affects the formatting API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant