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

Support full ints #22

Open
pnathan opened this issue Oct 9, 2021 · 0 comments
Open

Support full ints #22

pnathan opened this issue Oct 9, 2021 · 0 comments

Comments

@pnathan
Copy link
Owner

pnathan commented Oct 9, 2021

It's probable? we don't support all of the int formats TOML 1.0 does.

Integer
Integers are whole numbers. Positive numbers may be prefixed with a plus sign. Negative numbers are prefixed with a minus sign.

int1 = +99
int2 = 42
int3 = 0
int4 = -17
For large numbers, you may use underscores between digits to enhance readability. Each underscore must be surrounded by at least one digit on each side.

int5 = 1_000
int6 = 5_349_221
int7 = 53_49_221 # Indian number system grouping
int8 = 1_2_3_4_5 # VALID but discouraged
Leading zeros are not allowed. Integer values -0 and +0 are valid and identical to an unprefixed zero.

Non-negative integer values may also be expressed in hexadecimal, octal, or binary. In these formats, leading + is not allowed and leading zeros are allowed (after the prefix). Hex values are case-insensitive. Underscores are allowed between digits (but not between the prefix and the value).

hexadecimal with prefix 0x

hex1 = 0xDEADBEEF
hex2 = 0xdeadbeef
hex3 = 0xdead_beef

octal with prefix 0o

oct1 = 0o01234567
oct2 = 0o755 # useful for Unix file permissions

binary with prefix 0b

bin1 = 0b11010110
Arbitrary 64-bit signed integers (from −2^63 to 2^63−1) should be accepted and handled losslessly. If an integer cannot be represented losslessly, an error must be thrown.

@pnathan pnathan added this to the Support TOML v1.0 milestone Oct 9, 2021
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

No branches or pull requests

1 participant