[Bug 2182319] Perl YAML parser chokes on inconsistent indentation where Python does just fine.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=2182319



--- Comment #4 from Paul Howarth <paul@xxxxxxxxxxxx> ---
So here's the problematic snippet:

  hid: [
    0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07, 0x19, 0xe0, 0x29, 0xe7,
0x15, 0x00, 0x25, 0x01,
    0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0x95, 0x01, 0x75, 0x08, 0x81, 0x01,
0x95, 0x05, 0x75, 0x01,
    0x05, 0x08, 0x19, 0x01, 0x29, 0x05, 0x91, 0x02, 0x95, 0x01, 0x75, 0x03,
0x91, 0x01, 0x95, 0x06,
    0x75, 0x08, 0x15, 0x00, 0x26, 0xff, 0x00, 0x05, 0x07, 0x19, 0x00, 0x2a,
0x97, 0x00, 0x81, 0x00,
    0xc0
  ]

The closing bracket of this flow sequence is aligned with the first character
of the parent item ("hid:").

Looking here: https://www.yaml.info/learn/flowstyle.html
I see this:

=================================================================================
If the line gets too long, you can wrap it:

---
perl: [5.8, 5.10, 5.12, 5.14, 5.16, 5.18, 5.20, 5.22,
  5.24, 5.26, 5.28, 5.30]

You can also put the brackets on their own lines:

---
perl: [
    5.8, 5.10, 5.12, 5.14, 5.16, 5.18, 5.20, 5.22,
    5.24, 5.26, 5.28, 5.30
  ]

Note that even the last closing bracket must be indented (more than the parent
block style item), so the following would be invalid:

---
perl: [
  5.8, 5.10, 5.12, 5.14, 5.16, 5.18, 5.20, 5.22,
  5.24, 5.26, 5.28, 5.30
]

You might notice that many YAML parsers accept it, though. To be compatible
with all parsers, you should indent it.
=================================================================================

I also tried pasting the YAML here: https://yamlchecker.com/

It reported "deficient indentation (197:3)", again pointing to the closing
bracket.

So it would seem to me that TAML isn't being unreasonable about this, though it
could be more forgiving. Given that the upstream author suggests using YAML::XS
(see https://github.com/ingydotnet/yaml-pm), which is packaged as
perl-YAML-LibYAML by the way, I think that might be the better option for you.


-- 
You are receiving this mail because:
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2182319
_______________________________________________
perl-devel mailing list -- perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to perl-devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite Information]

  Powered by Linux