From: Clark C. E. <cc...@cl...> - 2004-09-08 23:56:42
|
Ok. Another pass; borrowing T.Onoma's idea to use '?' to signify an unspecified tag. We define parser syntax-shorthand rules, from the untagged varieties of each node/style to a final tag reported: untagged mapping -> ?mapping untagged sequence -> ?sequence untagged plain scalar -> ?scalar untagged other scalar -> tag:yaml.org,2002:str # Unicode String ! other scalar -> ?scalar Examples: --- # ?sequence - unspecified # ?scalar - "string" # tag:yaml.org,2002:str - {} # ?mapping - ! "implicit but quoted" # ?scalar - 'also string' # tag:yaml.org,2002:str - !!str unquoted but specified # tag:yaml.org,2002:str - > # tag:yaml.org,2002:str folded scalar - ! > # ?scalar implicit folded scalar ... Advantages: - no syntax production changes, just parser cooking rules - no way to accidently ask for a ?tag via the !tag mechanism, since !tag only makes global:uri or !private sorts of tags. - ?tag as reported signifies it is a 'meta' or 'unknown', the ? serves as a clear warning that this was an "implicit" tag and not provided by the author of the document. - ?tag has a _kind_ just like every other tag, this makes implementation easy for lookup tables, etc. - no special model or processing rules, application can do what ever it wishes with the 'implict' tags, which are neither private nor global. That's it. Clark P.S. If Oren wishes to include a 'resolution' phase that is in the spec that talks about how all '?tags' are converted to private or global tags... that is _fine_ with me. However, let's be perfectly clear here. I'm not asking for anyhthing other than a simple syntax parsing rule here. In particular, I'm not asking about "extra" steps, or anything else that is special. If an _application_ wishes to treat these bloddy ?implicti tags in a special manner... good for them. |