-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Previous directives don't apply to next documents in a YAML 1.1 stream #109
Comments
I think you may be mixing up two different things here. First, yes, global tags are meant to be globally unique URIs, so that e.g. Second, the So in order to make your stream example work, it'd need to be formatted a bit like this: %TAG !e! tag:example.com,2000:app/
---
- !e!foo "bar"
...
%TAG !e! tag:example.com,2000:app/
---
- !e!bar "baz" Also, this sounds a bit like you're raising an issue with the YAML spec rather than |
Issue for the JS library. I don't think the spec requires people to repeat the the same global tag prefix directive before every document across the source. It's tedious and should be avoided in a fine design. Every Unity scene file, which is a YAML 1.1 file, defines a global tag prefix once at the beginning:
And use its handle !u! in every document across the same file. |
Ah, drat. There's a difference between the 1.1 and 1.2 specs that I'd missed. YAML 1.1 says this:
YAML 1.2 on the other hand does not include that part, and instead says:
Furthermore, version 1.2 of the spec does not include a As a point of interest, YAML 1.0 was similarly clear on the matter, but OTOH the
But yeah, it does look like this should be fixed for YAML 1.1 document streams. Probably with a version-specific option, much like |
I've released 1.5.1, which fixes next-document handling for YAML 1.1 streams. I didn't add an option flag for it, as both the 1.0 and 1.2 specs specify rather opposite behaviour. However, that's not enough to make the Unity sample file compile right, as it includes a few documents like this (from line 222): --- !u!4 &242477465 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4289843246717992, guid: 1a0a6b589437e4d40ae72d9407472372,
type: 2}
m_PrefabInternal: {fileID: 1019440873} Note the |
Thanks, @eemeli It's likely Unity added some non-standard features in their YAML format. |
Actually the GUIDs are fine, those are just YAML anchors. It's the |
According to the requirement of Global Tag Prefix in spec 1.2:
And unfortunately, the example provided by the spec does not cover the requirement.
Example 6.22. Global Tag Prefix
Use it as a test case is not a good idea.
Try follows instead:
The text was updated successfully, but these errors were encountered: