Re: The same tag for different kinds
Andrey Somov <[email protected]> Thu, 10 Mar 2016 18:10:01 +0100
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <CALbkv0cHkshnvjwFEteQTGs5Z1bFQsByybhF1QmSQz95QKw_5A@mail.gmail.com> |
On Thu, Mar 10, 2016 at 5:39 PM, Oren Ben-Kiki <[email protected]> wrote: > Section 3.2.1.2 Tags: > "In particular, each tag must specify the expected node kind > <http://www.yaml.org/spec/1.2/spec.html#kind//> (scalar > <http://www.yaml.org/spec/1.2/spec.html#scalar//>, sequence > <http://www.yaml.org/spec/1.2/spec.html#sequence//>, or mapping > <http://www.yaml.org/spec/1.2/spec.html#mapping//>)". > Yes, I have read that and that is why I ask. The tag itself does not give any indication which node kind it needs. Or "each tag must specify the expected node kind" must be read as "each tag can only be applied to the node kind it is used with" ? My question is: should the parser be prepared to get a custom tag for different kinds ? Should the parser allow to configure to call different custom implementations for different kinds for the same tag ? Andrey > > > On Thu, Mar 10, 2016 at 5:35 PM, Andrey Somov <[email protected]> > wrote: > >> Hi all, >> does the specification put any restriction on how the same tag can be >> used for >> different node kinds (scalar, sequence, mapping) ? >> For instance, must the parser provide a possibility to define 3 different >> ways to construct a node for the document below ? >> Is this a valid document ? >> >> %YAML 1.1 >> --- >> scalar: !foo bar >> seq: !foo [bar] >> map: !foo {bar: null} >> >> Cheers, >> Andrey >> >> ------------------------------------------------------------------------------ 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=278785111&iu=/4140 _______________________________________________ Yaml-core mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/yaml-core