Skip to content
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

Support YAML 1.2 #3

Open
acatton opened this issue May 24, 2024 · 1 comment
Open

Support YAML 1.2 #3

acatton opened this issue May 24, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@acatton
Copy link
Owner

acatton commented May 24, 2024

This might be difficult, but we should try to support YAML 1.2 while keeping the same API. This issue tracks this. I might create sub issues as I see improvements.

@acatton acatton added this to the 1.0: Stable milestone May 24, 2024
@acatton acatton added the enhancement New feature or request label May 24, 2024
@Mingun
Copy link
Contributor

Mingun commented Sep 22, 2024

I seems that this crate partially uses YAML 1.2 rules, sometimes in number parsing:

serde-yaml-ng/src/de.rs

Lines 1092 to 1097 in c4903d7

pub(crate) fn digits_but_not_number(scalar: &str) -> bool {
// Leading zero(s) followed by numeric characters is a string according to
// the YAML 1.2 spec. https://yaml.org/spec/1.2/spec.html#id2761292
let scalar = scalar.strip_prefix(['-', '+']).unwrap_or(scalar);
scalar.len() > 1 && scalar.starts_with('0') && scalar[1..].bytes().all(|b| b.is_ascii_digit())
}

...and in tag resolution:
#[test]
fn test_tag_resolution() {
// https://yaml.org/spec/1.2.2/#1032-tag-resolution
let yaml = indoc! {"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants