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

Key followed by tab not parsed #52

Closed
jaakkor2 opened this issue May 3, 2023 · 0 comments · Fixed by JuliaLang/julia#51622
Closed

Key followed by tab not parsed #52

jaakkor2 opened this issue May 3, 2023 · 0 comments · Fixed by JuliaLang/julia#51622

Comments

@jaakkor2
Copy link
Contributor

jaakkor2 commented May 3, 2023

On Julia 1.8.3 and 1.9.0-rc3

import TOML
TOML.parse("foo\t=1")

gives

ERROR: TOML Parser error:
none:1:4 error: invalid bare key character: '\t'
  foo   =1
     ^
Stacktrace:
 [1] parse
   @ ./toml_parser.jl:441 [inlined]
 [2] parse(str::String)
   @ TOML /opt/julias/julia-1.8.3/share/julia/stdlib/v1.8/TOML/src/TOML.jl:71
 [3] top-level scope
   @ REPL[2]:1

This is fine

TOML.parse("\tfoo \t=\t1")

The spec https://toml.io/en/v1.0.0 says

Whitespace means tab (0x09) or space (0x20).

and

Keys are on the left of the equals sign and values are on the right. Whitespace is ignored around key names and values.

https://www.toml-lint.com/ seems to accept tab right after the key.

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 a pull request may close this issue.

1 participant