tags:

views:

82

answers:

1
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
)
+2  A: 

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)).

Joey
So it's legal when tab is used as delimit tokens,but illegal when used as indentation,is that right?
Read the spec. *“In YAML block styles, structure is determined by indentation. In general, indentation is defined as a zero or more space characters at the start of a line. To maintain portability, tab characters must not be used in indentation, since different systems treat tabs differently. Note that most modern editors may be configured so that pressing the tab key results in the insertion of an appropriate number of spaces.”* – so yes, tabs can't be used for indentation. But your example in the question didn't use it as such anyway.
Joey