-
Notifications
You must be signed in to change notification settings - Fork 327
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
YAML 1.2 support #20
Comments
The next step is to make a list of the changes needed to get there. |
Is "start from scratch" a valid change? |
@SoniEx2 you mean, |
@sigmavirus24 Yes. |
That may be a valid change, but it's not a change that would happen without good reasoning. What reasoning do you have for wanting to start from scratch? Further, if that's your desired first step, why not write a different implementation from scratch and forget this project? That's the easiest way to start from scratch. |
Refactoring is good. |
https://yaml.readthedocs.io/en/latest/pyyaml.html#defaulting-to-yaml-1-2-support |
Promising oss-fuzz in /src/oss-fuzz creates lots of confusion about where files come from. Let's make everything explicit. Fixes yaml#20
Just for reference from the 1.2 spec
|
Looks like most of the changes are dropped features. I would posit that most of the upgrade would be just dropping some tokens from the parse tree. Or course, I've been bitten by things that seem so simple in the past. There is an additional escape added. This upgrade has been lingering for several years and there's even a stale branch that claimed to be the 1.2 upgrade. If someone submitted a pull request, with tests to upgrade to 1.2 would this push this along? |
I think we should make a list of things that need to be changed.
There are probably more changes, but I think they are mostly removing ambiguity from the 1.1 spec. Can you think of anything else I should add? |
This will allow `%YAML 1.2` directives. See also #20 No changes are needed regarding tag directives. In YAML 1.2 tag directives are for the following document only. This is already implemented like that in libyaml. We would rather have to fix the code if we want to have the correct behaviour (global directives) in YAML 1.1. This would be a bit more complicated, as we would have to save the default version and the current version in the parser object. New passing parser tests: * 27NA: Spec Example 5.9. Directive Indicator * 6ZKB: Spec Example 9.6. Stream * 9DXL: Spec Example 9.6. Stream [1.3] * RTP8: Spec Example 9.2. Document Markers New failing error parser tests (before they were errors for the wrong reason): * EB22: Missing document-end marker before directive * RHX7: YAML directive without document end marker
Actually number 6 (Directives are not global anymore) is not implemented correctly in libyaml currently. Directives are not global. Fixing global directives for 1.1 would also be possible, but the question is if we want this. I created #172 |
This will simply allow `%YAML 1.2` directives additionally to `%YAML 1.1`. There is no change in behaviour. See also #20 No changes are needed regarding tag directives. In YAML 1.2 tag directives are for the following document only. This is already implemented like that in libyaml. We would rather have to fix the code if we want to have the correct behaviour (global directives) in YAML 1.1. This would be a bit more complicated, as we would have to save the default version and the current version in the parser object. New passing parser tests: * 27NA: Spec Example 5.9. Directive Indicator * 6ZKB: Spec Example 9.6. Stream * 9DXL: Spec Example 9.6. Stream [1.3] * RTP8: Spec Example 9.2. Document Markers New failing error parser tests (before they were errors for the wrong reason): * EB22: Missing document-end marker before directive * RHX7: YAML directive without document end marker
This will simply allow `%YAML 1.2` directives additionally to `%YAML 1.1`. There is no change in behaviour. See also #20 No changes are needed regarding tag directives. In YAML 1.2 tag directives are for the following document only. This is already implemented like that in libyaml. We would rather have to fix the code if we want to have the correct behaviour (global directives) in YAML 1.1. This would be a bit more complicated, as we would have to save the default version and the current version in the parser object. New passing parser tests: * 27NA: Spec Example 5.9. Directive Indicator * 6ZKB: Spec Example 9.6. Stream * 9DXL: Spec Example 9.6. Stream [1.3] * RTP8: Spec Example 9.2. Document Markers New failing error parser tests (before they were errors for the wrong reason): * EB22: Missing document-end marker before directive * RHX7: YAML directive without document end marker
This will simply allow `%YAML 1.2` directives additionally to `%YAML 1.1`. There is no change in behaviour. See also #20 No changes are needed regarding tag directives. In YAML 1.2 tag directives are for the following document only. This is already implemented like that in libyaml. We would rather have to fix the code if we want to have the correct behaviour (global directives) in YAML 1.1. This would be a bit more complicated, as we would have to save the default version and the current version in the parser object. New passing parser tests: * 27NA: Spec Example 5.9. Directive Indicator * 6ZKB: Spec Example 9.6. Stream * 9DXL: Spec Example 9.6. Stream [1.3] * RTP8: Spec Example 9.2. Document Markers New failing error parser tests (before they were errors for the wrong reason): * EB22: Missing document-end marker before directive * RHX7: YAML directive without document end marker
#172 was merged. How far is now 1.2 support? |
May be it is not my business, but the idea "YAML is a superset of JSON" is a bad idea at very beginning. |
As i see inital support for 1.2 already released as 0.2.3 (2020-04-11) but not clear what's left to do |
How does one compile the library to get the closest 1.2 support? Are there any configure options? |
See https://github.com/yaml/libyaml/wiki/YAML-1.2 for the status on YAML 1.2. |
Note that there are other things where libyaml diverges from the spec, that don't have anything to do with the differences of 1.1 and 1.2. I collected those cases for libyaml and pyyaml together here: https://github.com/yaml/pyyaml/wiki/Testsuite---Failing-cases |
@andry81 that has nothing to do with YAML 1.2 support, so it doesn't belong in this issue. |
I recommend to try out libfyaml. It fully supports YAML 1.2. Depending on your use cases it might already have every functionality you need. |
Hi, I'd like YAML 1.2 support.
The text was updated successfully, but these errors were encountered: