Skip to content

Key followed by tab not parsed #52

Closed
JuliaLang/julia
#51622

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions