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

lexer: TOML: Support more integer and floating formats #1831

Closed
ToruNiina opened this issue Jun 14, 2022 · 0 comments · Fixed by #1832
Closed

lexer: TOML: Support more integer and floating formats #1831

ToruNiina opened this issue Jun 14, 2022 · 0 comments · Fixed by #1832
Labels
bugfix-request A request for a bugfix to be developed. pr-open A PR addressing this issue is open.

Comments

@ToruNiina
Copy link
Contributor

Name of the lexer
TOML

Code sample

# float variants
float_space1 = 3.141_592_653
float_space2 = 123_456.789_012e1_000
just_inf = inf
pos_inf  = +inf
neg_inf  = -inf
just_nan = nan
pos_nan  = +nan
neg_nan  = -nan

# integer variants
dec         = 123456
dec_spacing = 123_456
hex         = 0xdeadBEEF
hex_spacing = 0xdead_BEEF
oct         = 0o755
oct_spacing = 0o755_777
bin         = 0b1100
bin_spacing = 0b0101_1100

# should be an error
float_no_int_part  = .1
float_no_frac_part = 1.

http://rouge.jneen.net/v3.29.0/toml/IyBmbG9hdCB2YXJpYW50cwpmbG9hdF9zcGFjZTEgPSAzLjE0MV81OTJfNjUzCmZsb2F0X3NwYWNlMiA9IDEyM180NTYuNzg5XzAxMmUxXzAwMApqdXN0X2luZiA9IGluZgpwb3NfaW5mICA9ICtpbmYKbmVnX2luZiAgPSAtaW5mCmp1c3RfbmFuID0gbmFuCnBvc19uYW4gID0gK25hbgpuZWdfbmFuICA9IC1uYW4KCiMgaW50ZWdlciB2YXJpYW50cwpkZWMgICAgICAgICA9IDEyMzQ1NgpkZWNfc3BhY2luZyA9IDEyM180NTYKaGV4ICAgICAgICAgPSAweGRlYWRCRUVGCmhleF9zcGFjaW5nID0gMHhkZWFkX0JFRUYKb2N0ICAgICAgICAgPSAwbzc1NQpvY3Rfc3BhY2luZyA9IDBvNzU1Xzc3NwpiaW4gICAgICAgICA9IDBiMTEwMApiaW5fc3BhY2luZyA9IDBiMDEwMV8xMTAwCgojIHNob3VsZCBiZSBhbiBlcnJvcgpmbG9hdF9ub19pbnRfcGFydCAgPSAuMQpmbG9hdF9ub19mcmFjX3BhcnQgPSAxLg

Additional context

Hi,
Thank you for developing and maintaining this library! I'm using an application that depends on this library almost everyday.

Today I found that some TOML features listed below are currently not supported.

TOML v1.0.0 supports the following features:

I also found the current TOML lexer allows floating point numbers that lacks integer part xor fractional part. But those are actually invalid.
In TOML, floating point value should have both integer and fractional parts.

I'm now writing a pull request that supports the features and fix the bug listed above.
Thanks for your time!

@ToruNiina ToruNiina added the bugfix-request A request for a bugfix to be developed. label Jun 14, 2022
@tancnle tancnle added the pr-open A PR addressing this issue is open. label Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed. pr-open A PR addressing this issue is open.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants