Re: indentation indicator at document root
Oren Ben-Kiki <[email protected]> Fri, 25 Mar 2016 13:51:17 +0300
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <CADJiDhvO+NpteB12Q6wVZfu9o-HVUKzwF7rRu_An7mEF5437kA@mail.gmail.com> |
Hmmm. I don't recall this being brought up at the time. Good questions. Ingy's proposal to eliminate the integer indicator and replacing it with the position of the `|` would have avoided it, but we didn't think of it at the time (a pity). At any rate, a literal reading of the spec does give rise to the interpretation you gave. I guess we have to live with it? At least until such time as we have 1.3 or something of that sort. Nice catch... Oren. On Fri, Mar 25, 2016 at 1:20 PM, flyx <[email protected]> wrote: > Hi folks, > > the spec defines the indentation level of a document’s root node parent > as -1 (9.3.1). So when the document contains a block scalar as root node > with explicit indentation indicator, this leads to unexpected results: > > %YAML 1.2 > --- |1 > foo > > The above is valid according to spec, which says about the indentation > indicator „This level is specified as the integer number of the > additional indentation spaces used for the content, relative to its > parent node“. Since -1 (parent node indentation) + 1 (given integer > number) is 0, and that’s the indentation of the scalar "foo", this is > valid YAML. The reference parser handles this correctly, while PyYaml > does not. Is this intended? > > Cheers, > Felix > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140 > _______________________________________________ > Yaml-core mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/yaml-core > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140 _______________________________________________ Yaml-core mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/yaml-core