user198729
user198729

Reputation: 63676

Why is tab valid in key/value pair in YAML parser?

t: test

Pay attention that it's a tab after :,and I used this YAML parser to test whether it's valid or not(IMO it's not valid):

Array
(
    [t] => test
)

Upvotes: 5

Views: 2440

Answers (1)

Joey
Joey

Reputation: 354684

According to the specification, both tab (U+0009) and space (U+0020) are considered “white space characters” that may be used to delimit tokens.

So what makes you think it's illegal in that context? Especially considering that example 6.3 makes it clear that it's valid:

Example 6.3. Separation Spaces

-·foo:→·bar
- -·baz
  -→baz 

(· denotes a space (U+0020), while denotes a tab character (U+0009)).

Upvotes: 6

Related Questions